mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Cleanup _.matches.
This commit is contained in:
18
lodash.js
18
lodash.js
@@ -9238,15 +9238,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var index = length,
|
var index = length,
|
||||||
flags = Array(length),
|
values = Array(length),
|
||||||
vals = Array(length);
|
strictCompareFlags = Array(length);
|
||||||
|
|
||||||
while (index--) {
|
while (index--) {
|
||||||
value = source[props[index]];
|
value = source[props[index]];
|
||||||
var isStrict = isStrictComparable(value);
|
var isStrict = isStrictComparable(value);
|
||||||
|
|
||||||
flags[index] = isStrict;
|
values[index] = isStrict ? value : baseClone(value, true, matchesCloneCallback);
|
||||||
vals[index] = isStrict ? value : baseClone(value);
|
strictCompareFlags[index] = isStrict;
|
||||||
}
|
}
|
||||||
return function(object) {
|
return function(object) {
|
||||||
index = length;
|
index = length;
|
||||||
@@ -9254,13 +9254,19 @@
|
|||||||
return !index;
|
return !index;
|
||||||
}
|
}
|
||||||
while (index--) {
|
while (index--) {
|
||||||
if (flags[index] ? vals[index] !== object[props[index]] : !hasOwnProperty.call(object, props[index])) {
|
if (strictCompareFlags[index]
|
||||||
|
? values[index] !== object[props[index]]
|
||||||
|
: !hasOwnProperty.call(object, props[index])
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index = length;
|
index = length;
|
||||||
while (index--) {
|
while (index--) {
|
||||||
if (flags[index] ? !hasOwnProperty.call(object, props[index]) : !baseIsEqual(vals[index], object[props[index]], null, true)) {
|
if (strictCompareFlags[index]
|
||||||
|
? !hasOwnProperty.call(object, props[index])
|
||||||
|
: !baseIsEqual(values[index], object[props[index]], null, true)
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user