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