From 19836a55a3832f37d4f2475ecae3c8df9f5d55a0 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 16 Jul 2015 09:19:11 -0700 Subject: [PATCH] Remove an `isArray` check from `baseMatchesProperty`. --- lodash.src.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 188a2c493..171a5e78f 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -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 * @param {string} path The path of the property to get. @@ -2228,8 +2228,7 @@ * @returns {Function} Returns the new function. */ function baseMatchesProperty(path, srcValue) { - var isArr = isArray(path), - isCommon = isKey(path) && isStrictComparable(srcValue), + var isCommon = isKey(path) && isStrictComparable(srcValue), pathKey = (path + ''); path = toPath(path); @@ -2238,7 +2237,7 @@ return false; } 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)); if (object == null) { return false;