* The base implementation of `_.matchesProperty` which does not which does * not clone `value`. * * @private * @param {string} path The path of the property to get. * @param {*} value The value to compare. * @returns {Function} Returns the new function.
(path, value)
| 3869 | * @returns {Function} Returns the new function. |
| 3870 | */ |
| 3871 | function baseMatchesProperty(path, value) { |
| 3872 | var isArr = isArray(path), |
| 3873 | isCommon = isKey(path) && isStrictComparable(value), |
| 3874 | pathKey = (path + ''); |
| 3875 | |
| 3876 | path = toPath(path); |
| 3877 | return function(object) { |
| 3878 | if (object == null) { |
| 3879 | return false; |
| 3880 | } |
| 3881 | var key = pathKey; |
| 3882 | object = toObject(object); |
| 3883 | if ((isArr || !isCommon) && !(key in object)) { |
| 3884 | object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); |
| 3885 | if (object == null) { |
| 3886 | return false; |
| 3887 | } |
| 3888 | key = last(path); |
| 3889 | object = toObject(object); |
| 3890 | } |
| 3891 | return object[key] === value |
| 3892 | ? (value !== undefined || (key in object)) |
| 3893 | : baseIsEqual(value, object[key], null, true); |
| 3894 | }; |
| 3895 | } |
| 3896 | |
| 3897 | /** |
| 3898 | * The base implementation of `_.merge` without support for argument juggling, |
no test coverage detected