MCPcopy
hub / github.com/tdewolff/minify / baseMatchesProperty

Function baseMatchesProperty

_benchmarks/sample_victory.js:14022–14032  ·  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

14020 * @returns {Function} Returns the new spec function.
14021 */
14022function baseMatchesProperty(path, srcValue) {
14023 if (isKey(path) && isStrictComparable(srcValue)) {
14024 return matchesStrictComparable(toKey(path), srcValue);
14025 }
14026 return function(object) {
14027 var objValue = get(object, path);
14028 return (objValue === undefined && objValue === srcValue)
14029 ? hasIn(object, path)
14030 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
14031 };
14032}
14033
14034module.exports = baseMatchesProperty;
14035

Callers 1

baseIterateeFunction · 0.85

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…