Bump to v3.6.0.

This commit is contained in:
jdalton
2015-03-24 19:28:36 -07:00
parent ee1f12c851
commit 801ffd8adf
193 changed files with 1213 additions and 976 deletions

View File

@@ -1,12 +1,8 @@
import baseIsMatch from './baseIsMatch';
import constant from '../utility/constant';
import isStrictComparable from './isStrictComparable';
import keys from '../object/keys';
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
import toObject from './toObject';
/**
* The base implementation of `_.matches` which does not clone `source`.
@@ -19,13 +15,17 @@ function baseMatches(source) {
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)));
};
}
}
@@ -38,7 +38,7 @@ function baseMatches(source) {
strictCompareFlags[length] = isStrictComparable(value);
}
return function(object) {
return baseIsMatch(object, props, values, strictCompareFlags);
return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
};
}