mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Ensure _.merge passes the right arguments to the callback when comparing objects. [closes #231]
Former-commit-id: 7c1ff861f753d3a2bdf62a753c94df2052d03d78
This commit is contained in:
9
dist/lodash.compat.js
vendored
9
dist/lodash.compat.js
vendored
@@ -2029,10 +2029,6 @@
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
|
||||
var isShallow;
|
||||
if (callback) {
|
||||
result = callback(value, source);
|
||||
@@ -2040,6 +2036,11 @@
|
||||
value = result;
|
||||
}
|
||||
}
|
||||
if (!isShallow) {
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
}
|
||||
// add `source` and associated `value` to the stack of traversed objects
|
||||
stackA.push(source);
|
||||
stackB.push(value);
|
||||
|
||||
Reference in New Issue
Block a user