UNPKG

merge-left-utils

Version:

Merge objects without structure changes

9 lines (7 loc) 327 B
import type { DeepPartial } from './util'; /** Shortcut function Replace only fields from [keys] arg in {a} with {b} ex: (['b'], { a: 0, b: 0 }, { a: 1, b: 1 }) -> { a: 0, b: 1 } */ export declare function mergeLeftOnly<T extends Record<string, any>>(keys: Array<keyof T>, source: T, target?: DeepPartial<T>): T;