(target: T, ...args: any[])
| 27 | } |
| 28 | |
| 29 | export function mergeWith<T>(target: T, ...args: any[]): T { |
| 30 | const customizer: ((a: any, b: any, key: string) => any) | undefined = args.pop(); |
| 31 | const sources: any[] = args; |
| 32 | |
| 33 | for (const source of sources) { |
| 34 | if (source == null) { |
| 35 | continue; |
| 36 | } |
| 37 | for (const key of Object.keys(source)) { |
| 38 | baseMergeValue(target as any, source, key, customizer); |
| 39 | } |
| 40 | } |
| 41 | return target; |
| 42 | } |
| 43 | |
| 44 | function baseMergeValue(target: Record<string, any>, source: Record<string, any>, key: string, customizer?: (a: any, b: any, key: string) => any): void { |
| 45 | const srcValue = source[key]; |
no test coverage detected