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

Function has

lib/web/jshint.js:10899–10911  ·  view source on GitHub ↗

* Checks if `path` is a direct property. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.

(object, path)

Source from the content-addressed store, hash-verified

10897 * // => true
10898 */
10899 function has(object, path) {
10900 if (object == null) {
10901 return false;
10902 }
10903 var result = hasOwnProperty.call(object, path);
10904 if (!result && !isKey(path)) {
10905 path = toPath(path);
10906 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
10907 path = last(path);
10908 result = object != null && hasOwnProperty.call(object, path);
10909 }
10910 return result;
10911 }
10912
10913 /**
10914 * Creates an object composed of the inverted keys and values of `object`.

Callers 11

setToStringTagFunction · 0.70
getFunction · 0.70
defineIteratorFunction · 0.70
isIterableFunction · 0.70
polyfill.jsFile · 0.70
runFunction · 0.70
getCollectionFunction · 0.70
fastKeyFunction · 0.70
defWeakFunction · 0.70
reflectGetFunction · 0.70
reflectSetFunction · 0.70

Calls 6

isKeyFunction · 0.85
toPathFunction · 0.85
baseGetFunction · 0.85
baseSliceFunction · 0.85
lastFunction · 0.70
callMethod · 0.45

Tested by

no test coverage detected