Bump to v3.6.0.

This commit is contained in:
John-David Dalton
2015-12-16 17:49:07 -08:00
parent 707fe171fc
commit 9724afd7a6
193 changed files with 2191 additions and 1764 deletions

View File

@@ -1,10 +1,4 @@
define(['./baseIsMatch', './isStrictComparable', '../object/keys'], function(baseIsMatch, isStrictComparable, keys) {
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
define(['./baseIsMatch', '../utility/constant', './isStrictComparable', '../object/keys', './toObject'], function(baseIsMatch, constant, isStrictComparable, keys, toObject) {
/**
* The base implementation of `_.matches` which does not clone `source`.
@@ -17,13 +11,17 @@ define(['./baseIsMatch', './isStrictComparable', '../object/keys'], function(bas
var props = keys(source),
length = props.length;
if (!length) {
return constant(true);
}
if (length == 1) {
var key = props[0],
value = source[key];
if (isStrictComparable(value)) {
return function(object) {
return object != null && object[key] === value && hasOwnProperty.call(object, key);
return object != null && object[key] === value &&
(typeof value != 'undefined' || (key in toObject(object)));
};
}
}
@@ -36,7 +34,7 @@ define(['./baseIsMatch', './isStrictComparable', '../object/keys'], function(bas
strictCompareFlags[length] = isStrictComparable(value);
}
return function(object) {
return baseIsMatch(object, props, values, strictCompareFlags);
return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
};
}