Ensure _.defaultsDeep doesn't modify sources.

This commit is contained in:
John-David Dalton
2015-10-11 01:39:30 -07:00
parent 414ad602f2
commit a08d52eb48
2 changed files with 16 additions and 3 deletions

View File

@@ -4786,10 +4786,10 @@
*/
function mergeDefaults(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue)) {
stack.set(objValue, objValue);
stack.set(srcValue, objValue);
baseMerge(objValue, srcValue, mergeDefaults, stack);
}
return objValue === undefined ? srcValue : objValue;
return objValue === undefined ? baseClone(srcValue) : objValue;
}
/**