merge-left-utils
Version:
Merge objects without structure changes
9 lines (7 loc) • 360 B
TypeScript
import type { DeepPartial } from './util';
/**
Shortcut function
Replace only existing fields in {a} with {b} skipping {b} keys from {keys}
ex: (['a'], { a: 0, b: 0 }, { a: 1, b: 1 }) -> { a: 0, b: 1 }
*/
export declare function mergeLeftExcept<T extends Record<string, any>>(skippingKeys: Array<keyof T>, source: T, target?: DeepPartial<T>): T;