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