deepmerge-plus
Version:
A library for deep (recursive) merging of Javascript objects
30 lines (27 loc) • 1.12 kB
TypeScript
export declare function _isMergeableObject(value: any, optionsArgument: IOptions, tmp?: ICache): boolean;
export declare function deepmerge<T1, T2>(x: T1, y: T2, options?: IOptions): Partial<T1 & T2>;
export declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: IOptions): Partial<T>;
export interface ICache {
key?: any;
source?: any;
target?: any;
destination?: any;
}
export interface IOptions {
clone?: boolean;
arrayMerge?(destination: any[], source: any[], options?: IOptions): any[];
isMergeableObject?(value: any, isMergeableObject: typeof isMergeable, optionsArgument?: IOptions, key?: any): void;
isMergeableObject?(value: any, isMergeableObject: typeof isMergeable, optionsArgument?: IOptions, key?: any): boolean;
/**
* (val = old || new) mode
*/
keyValueOrMode?: boolean;
}
export declare function isMergeable(value: any): boolean;
export declare const SYMBOL_IS_MERGEABLE: unique symbol;
export declare function deepmergeAll<T, T2 = any>(array: Array<Partial<T2 & T>>, optionsArgument?: IOptions): T2 & T;
export {
deepmerge as default,
deepmergeAll as all,
};
export {};