@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
76 lines (75 loc) • 3.56 kB
TypeScript
/**
* Returns a new object with the property updated.
* The property is identified by the path.
*
* @param obj Object
* @param path path to the property
* @param value new property value
* @returns
*/
export declare function setInPath<T>(obj: any, path: string[], value: any): T;
export declare function isObjectEmpty(obj?: any): boolean;
export declare const deepClone: (obj: any) => any;
export declare const diff: <T extends {
[key: string]: unknown;
}>(obj1: T, obj2: T) => (keyof T)[];
/**
* Checks if `value` is the language type of Object.
* (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))
* Drop-in replacement for lodash/isObject.
*/
export declare function isObject(value: any): value is object;
/**
* Checks if `value` is a plain object, that is, an object created by the
* Object constructor or one with a [[Prototype]] of null.
* Drop-in replacement for lodash/isPlainObject.
*/
export declare function isPlainObject(value: any): value is Record<string, any>;
/**
* Performs a deep comparison between two values to determine if they are equivalent.
* Drop-in replacement for lodash/isEqual.
*/
export declare function isEqual(value: any, other: any): boolean;
type CloneCustomizer = (value: any) => any;
/**
* Like `cloneDeep` except that it accepts a customizer which is invoked to
* produce the cloned value. If the customizer returns `undefined`, cloning is
* handled by the method instead.
* Drop-in replacement for lodash/cloneDeepWith.
*/
export declare function cloneDeepWith<T>(value: T, customizer: CloneCustomizer): T;
/**
* Recursively merges own enumerable string-keyed properties of source objects
* into `target`. Source properties that resolve to `undefined` are skipped if a
* destination value exists. Array and plain object properties are merged
* recursively; other values are overridden by assignment.
* Drop-in replacement for lodash/merge.
*/
export declare function merge<TObject, TSource1>(object: TObject, source1: TSource1): TObject & TSource1;
export declare function merge<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
export declare function merge<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3;
export declare function merge(target: any, ...sources: any[]): any;
/**
* Like `merge` except that it accepts a customizer which is invoked to produce
* the merged values of the destination and source properties. If the customizer
* returns `undefined`, merging is handled by the method instead.
* Drop-in replacement for lodash/mergeWith.
*/
export declare function mergeWith<T extends object>(target: T, ...args: any[]): T;
/**
* Recursively fills in missing properties on `target` from one or more
* `sources` (defaults). For each key:
*
* - if the target value is `undefined`, it is replaced with a fresh clone of
* the source value;
* - if both the target and source values are plain objects, the merge recurses
* into them (the target's nested object is shallow-copied first, so the
* caller's input is never mutated);
* - otherwise the target value wins as-is (arrays, functions, primitives, class
* instances etc. are NOT element-merged — the user's value replaces the
* default entirely).
*
* Drop-in replacement for lodash/defaultsDeep.
*/
export declare function defaultsDeep<T extends object>(target: T, ...sources: any[]): T;
export {};