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.js
vendored
9
dist/lodash.js
vendored
@@ -1820,10 +1820,6 @@
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
value = isArr
|
||||
? (isArray(value) ? value : [])
|
||||
: (isPlainObject(value) ? value : {});
|
||||
|
||||
var isShallow;
|
||||
if (callback) {
|
||||
result = callback(value, source);
|
||||
@@ -1831,6 +1827,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