mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Avoid iterating strings in _.merge. [closes #978]
This commit is contained in:
@@ -2548,8 +2548,10 @@
|
||||
* @returns {Object} Returns the destination object.
|
||||
*/
|
||||
function baseMerge(object, source, customizer, stackA, stackB) {
|
||||
if (!isObjectLike(object)) {
|
||||
return object;
|
||||
}
|
||||
var isSrcArr = isLength(source.length) && (isArray(source) || isTypedArray(source));
|
||||
|
||||
(isSrcArr ? arrayEach : baseForOwn)(source, function(srcValue, key, source) {
|
||||
if (isObjectLike(srcValue)) {
|
||||
stackA || (stackA = []);
|
||||
|
||||
Reference in New Issue
Block a user