mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Bump to v3.9.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
define(['../internal/baseIsMatch', '../internal/bindCallback', '../internal/isStrictComparable', '../object/keys', '../internal/toObject'], function(baseIsMatch, bindCallback, isStrictComparable, keys, toObject) {
|
||||
define(['../internal/baseIsMatch', '../internal/bindCallback', '../internal/getMatchData'], function(baseIsMatch, bindCallback, getMatchData) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -43,33 +43,8 @@ define(['../internal/baseIsMatch', '../internal/bindCallback', '../internal/isSt
|
||||
* // => true
|
||||
*/
|
||||
function isMatch(object, source, customizer, thisArg) {
|
||||
var props = keys(source),
|
||||
length = props.length;
|
||||
|
||||
if (!length) {
|
||||
return true;
|
||||
}
|
||||
if (object == null) {
|
||||
return false;
|
||||
}
|
||||
customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3);
|
||||
object = toObject(object);
|
||||
if (!customizer && length == 1) {
|
||||
var key = props[0],
|
||||
value = source[key];
|
||||
|
||||
if (isStrictComparable(value)) {
|
||||
return value === object[key] && (value !== undefined || (key in object));
|
||||
}
|
||||
}
|
||||
var values = Array(length),
|
||||
strictCompareFlags = Array(length);
|
||||
|
||||
while (length--) {
|
||||
value = values[length] = source[props[length]];
|
||||
strictCompareFlags[length] = isStrictComparable(value);
|
||||
}
|
||||
return baseIsMatch(object, props, values, strictCompareFlags, customizer);
|
||||
customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
|
||||
return baseIsMatch(object, getMatchData(source), customizer);
|
||||
}
|
||||
|
||||
return isMatch;
|
||||
|
||||
Reference in New Issue
Block a user