mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Ensure _.isMatch handle customizer functions correctly.
This commit is contained in:
18
lodash.js
18
lodash.js
@@ -2411,14 +2411,14 @@
|
||||
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
|
||||
*/
|
||||
function baseIsMatch(object, props, values, customizer, strictCompareFlags) {
|
||||
var length = props.length,
|
||||
index = length;
|
||||
var index = -1,
|
||||
length = props.length;
|
||||
|
||||
if (object == null) {
|
||||
return !index;
|
||||
return !length;
|
||||
}
|
||||
strictCompareFlags || (strictCompareFlags = []);
|
||||
while (index--) {
|
||||
while (++index < length) {
|
||||
if (strictCompareFlags[index]
|
||||
? values[index] !== object[props[index]]
|
||||
: !hasOwnProperty.call(object, props[index])
|
||||
@@ -2426,8 +2426,8 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
index = length;
|
||||
while (index--) {
|
||||
index = -1;
|
||||
while (++index < length) {
|
||||
var key = props[index];
|
||||
if (strictCompareFlags[index]) {
|
||||
var result = hasOwnProperty.call(object, key);
|
||||
@@ -2441,7 +2441,7 @@
|
||||
}
|
||||
}
|
||||
if (!result) {
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -3258,7 +3258,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return !!result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3346,7 +3346,7 @@
|
||||
}
|
||||
}
|
||||
if (!result) {
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
hasCtor || (hasCtor = key == 'constructor');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user