yeoman-generator
Version:
Rails-inspired generator system that provides scaffolding for your apps
29 lines (28 loc) • 1.39 kB
TypeScript
/**
* Object helpers of the storage, with the behavior of the lodash functions of the same name for the JSON-like data a
* storage holds: plain objects, arrays and primitives.
*/
/**
* The value at a path of an object, like lodash `get`.
*/
export declare const get: (object: unknown, path: PropertyKey | readonly PropertyKey[]) => any;
/**
* Set the value at a path of an object, creating the missing objects (arrays for an index), like lodash `set`.
*/
export declare const set: <T>(object: T, path: PropertyKey | readonly PropertyKey[], value: unknown) => T;
/**
* Assign to the target the properties of the sources it has as undefined, the first source first, like lodash
* `defaults`.
*/
export declare const defaults: <T extends object>(target: T, ...sources: Array<object | undefined>) => T;
/**
* A deep copy of the arrays and plain objects of a value, the other values kept, like lodash `cloneDeep` for JSON-like
* data.
*/
export declare const cloneDeep: <T>(value: T) => T;
/**
* Merge the sources into the target, recursively for the plain objects and arrays (by index), like lodash `merge`.
*/
export declare function merge<T extends object, S>(target: T, source: S): T & S;
export declare function merge<T extends object, S1, S2>(target: T, source1: S1, source2: S2): T & S1 & S2;
export declare function merge(target: object, ...sources: unknown[]): any;