softkave-js-utils
Version:
JavaScript & Typescript utility functions, types, and classes
11 lines (10 loc) • 503 B
TypeScript
export interface MergeObjectMeta {
/**
* `merge` - lodash-es's default, check out lodash-es's `mergeWith` for details.
* `concat` - Joins both arrays, returning a new array.
* `replace` - Replaces the old array with the new array value.
* `retain` - Retains the old array value.
*/
arrayUpdateStrategy: 'merge' | 'concat' | 'replace' | 'retain';
}
export declare const mergeObjects: <T1 = unknown, T2 = unknown>(dest: T1, source: T2, meta?: MergeObjectMeta) => T1 & T2;