MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / baseMatchesProperty

Function baseMatchesProperty

lib/web/jshint.js:3871–3895  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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,

Callers 2

baseCallbackFunction · 0.85
matchesPropertyFunction · 0.85

Calls 9

isKeyFunction · 0.85
isStrictComparableFunction · 0.85
toPathFunction · 0.85
baseGetFunction · 0.85
baseSliceFunction · 0.85
baseIsEqualFunction · 0.85
isArrayFunction · 0.70
toObjectFunction · 0.70
lastFunction · 0.70

Tested by

no test coverage detected