evolve-ts
Version:
Immutably update nested objects with patches containing values or functions to update values
17 lines (16 loc) • 1.47 kB
TypeScript
import { Adjust, Evolve, Evolve_, MapArray, ShallowEvolve, ShallowAdjust, ShallowMapArray } from "./interfaces";
export * from "./interfaces";
/** deeply merges changes from a patch object into a target object, the patch object can contain new values or functions to update values */
export declare const evolve: Evolve;
/** polymorphic type alias for evolve: deeply merges changes from a patch object into a target object, the patch object can contain new values or functions to update values */
export declare const evolve_: Evolve_;
/** merges changes from a patch object into a target object, the patch object can contain new values or functions to update values */
export declare const shallowEvolve: ShallowEvolve;
/** conditionally maps values in an array with a callback function or patch. Value(s) to map can be specified with an index or predicate function. Negative indexes are treated as offsets from the array length */
export declare const adjust: Adjust;
/** conditionally maps values in an array with a callback function or patch. Value(s) to map can be specified with an index or predicate function. Negative indexes are treated as offsets from the array length */
export declare const shallowAdjust: ShallowAdjust;
/** maps values in an array with a callback function or patch */
export declare const map: MapArray;
/** maps values in an array with a callback function or patch */
export declare const shallowMap: ShallowMapArray;