defSetter<T, A, B>(path: Path2<T, A, B>): Fn2<T, PathVal<T, [A, B]>, T>
defSetter<T, A, B, C>(path: Path3<T, A, B, C>): Fn2<T, PathVal<T, [A, B, C]>, T>
defSetter<T, A, B, C, D>(path: Path4<T, A, B, C, D>): Fn2<T, PathVal<T, [A, B, C, D]>, T>
defSetter<T, A, B, C, D, E>(path: Path5<T, A, B, C, D, E>): Fn2<T, PathVal<T, [A, B, C, D, E]>, T>
defSetter<T, A, B, C, D, E, F>(path: Path6<T, A, B, C, D, E, F>): Fn2<T, PathVal<T, [A, B, C, D, E, F]>, T>
defSetter<T, A, B, C, D, E, F, G>(path: Path7<T, A, B, C, D, E, F, G>): Fn2<T, PathVal<T, [A, B, C, D, E, F, G]>, T>
defSetter<T, A, B, C, D, E, F, G, H>(path: Path8<T, A, B, C, D, E, F, G, H>): Fn2<T, PathVal<T, [A, B, C, D, E, F, G, H]>, T>
defSetter<T, A, B, C, D, E, F, G, H>(path: DeepPath<T, A, B, C, D, E, F, G, H>): Fn2<T, any, any>
Type checked version of defSetterUnsafe. Only the first 8 path levels are type checked.
remarks
Due to the higher-order nature of this function, generics for path validation must be given and so this function is more verbose than setIn (where the generics can usually be fully inferred).
Composes a setter function for given nested update path. Optimized fast execution paths are provided for path lengths less up to 4.
remarks
Supports both arrays and objects and creates intermediate shallow copies at each level of the path. Thus provides structural sharing with the original data for any branches not being updated by the setter.
The type parameter T can be used to indicate the type of the nested value to be updated (default: any).
If path is given as string, it will be split using .. Returns function which accepts single object and when called, immutably updates value at given path, i.e. produces a partial deep copy of obj up until given path.
If any intermediate key is not present in the given obj, creates a plain empty object for that key and descends further.
If path is an empty string or array, the returned setter will simply return the new value.
Only keys in the path will be modified, all other keys present in the given object retain their original values to provide efficient structural sharing / re-use.
Helper for defSetter. Returns setter for a single step.