File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ Fix the bug in `mergeDeep`;
66
77The following inputs and outputs are corrected;
88
9- - ` mergeDeep([{a:2} undefined]) ` - Any nullish values should be ignored so it should return ` {a:2} `
9+ - ` mergeDeep([{a:2}, undefined]) ` - Any nullish values should be ignored so it should return ` {a:2} `
1010- ` mergeDeep([]) ` - no sources should return ` undefined `
1111- ` mergeDeep([undefined]) ` - no sources should return ` undefined `
Original file line number Diff line number Diff line change @@ -52,10 +52,10 @@ export function mergeDeep<S extends any[]>(
5252 let firstObjectSource : any ;
5353 if ( respectPrototype ) {
5454 firstObjectSource = sources . find ( source => isObject ( source ) ) ;
55- if ( output == null ) {
56- output = { } ;
57- }
5855 if ( firstObjectSource ) {
56+ if ( output == null ) {
57+ output = { } ;
58+ }
5959 Object . setPrototypeOf ( output , Object . create ( Object . getPrototypeOf ( firstObjectSource ) ) ) ;
6060 }
6161 }
You can’t perform that action at this time.
0 commit comments