MCPcopy
hub / github.com/lodash/lodash / baseMatchesProperty

Function baseMatchesProperty

lodash.js:3620–3630  ·  view source on GitHub ↗

* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function.

(path, srcValue)

Source from the content-addressed store, hash-verified

3618 * @returns {Function} Returns the new spec function.
3619 */
3620 function baseMatchesProperty(path, srcValue) {
3621 if (isKey(path) && isStrictComparable(srcValue)) {
3622 return matchesStrictComparable(toKey(path), srcValue);
3623 }
3624 return function(object) {
3625 var objValue = get(object, path);
3626 return (objValue === undefined && objValue === srcValue)
3627 ? hasIn(object, path)
3628 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
3629 };
3630 }
3631
3632 /**
3633 * The base implementation of `_.merge` without support for multiple sources.

Callers 2

baseIterateeFunction · 0.85
matchesPropertyFunction · 0.85

Calls 7

isKeyFunction · 0.85
isStrictComparableFunction · 0.85
matchesStrictComparableFunction · 0.85
toKeyFunction · 0.85
getFunction · 0.85
hasInFunction · 0.85
baseIsEqualFunction · 0.85

Tested by

no test coverage detected