import type { DeepPath , OptPathVal , Path , Path0 , Path1 , Path2 , Path3 , Path4 , Path5 , Path6 , Path7 , Path8 , PathVal , } from "@thi.ng/api" ; import type { UpdateFn } from "./api.js" ; import { defGetter } from "./getter.js" ; import { defSetter } from "./setter.js" ; /**
 * Similar to  setInUnsafe , but applies given function to current
 * path value (incl. any additional/optional arguments passed to
 * `updateIn`) and uses result as new value. Does not modify original
 * state.
 *
 *  remarks Unchecked version of  updateIn . The type parameter `T` can be
 * used to indicate the type of the nested value to be updated (default:
 * `any`).
 *
 *  example param state param path param fn param args export const updateInUnsafe = < T = any > ( state , path , fn , ... args ) => updateIn ( state , path , fn , ... args ) ; /**
 * Type checked version of  updateIn . Only the first 8 path
 * levels are type checked.
 *
 *  param state param path param fn export function updateIn < T > ( state , path , fn ) ; export function updateIn < T , A > ( state , path , fn , ... args ) ; export function updateIn < T , A , B > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C , D > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C , D , E > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C , D , E , F > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C , D , E , F , G > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C , D , E , F , G , H > ( state , path , fn , ... args ) ; export function updateIn < T , A , B , C , D , E , F , G , H > ( state , path , fn , ... args ) ; export function updateIn ( state , path , fn , ... args ) { return defSetter ( < any > path ) ( state , fn . apply ( null , ( args . unshift ( defGetter ( path ) ( state ) ) , args ) ) ) ; }