mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Adjust handling of typed arrays and arguments objects in baseMergeDeep.
This commit is contained in:
committed by
jdalton
parent
cccd43a16b
commit
6683809447
@@ -2522,9 +2522,11 @@
|
|||||||
if (isCommon) {
|
if (isCommon) {
|
||||||
result = srcValue;
|
result = srcValue;
|
||||||
if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) {
|
if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) {
|
||||||
result = isArray(value) ? value : [];
|
result = isArray(value) ? value : arrayCopy(value);
|
||||||
} else if (isPlainObject(srcValue)) {
|
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||||
result = isPlainObject(value) ? value : {};
|
result = isArguments(value)
|
||||||
|
? arrayToObject(value)
|
||||||
|
: (isPlainObject(value) ? value : {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add the source value to the stack of traversed objects and associate
|
// Add the source value to the stack of traversed objects and associate
|
||||||
|
|||||||
Reference in New Issue
Block a user