mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Remove an isArray check from baseMatchesProperty.
This commit is contained in:
@@ -2220,7 +2220,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.matchesProperty` which does not clone `srcValue`.
|
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {string} path The path of the property to get.
|
* @param {string} path The path of the property to get.
|
||||||
@@ -2228,8 +2228,7 @@
|
|||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
*/
|
*/
|
||||||
function baseMatchesProperty(path, srcValue) {
|
function baseMatchesProperty(path, srcValue) {
|
||||||
var isArr = isArray(path),
|
var isCommon = isKey(path) && isStrictComparable(srcValue),
|
||||||
isCommon = isKey(path) && isStrictComparable(srcValue),
|
|
||||||
pathKey = (path + '');
|
pathKey = (path + '');
|
||||||
|
|
||||||
path = toPath(path);
|
path = toPath(path);
|
||||||
@@ -2238,7 +2237,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var key = pathKey;
|
var key = pathKey;
|
||||||
if ((isArr || !isCommon) && !(key in Object(object))) {
|
if (!isCommon && !(key in Object(object))) {
|
||||||
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user