MCPcopy Index your code
hub / github.com/deployd/deployd / isKey

Function isKey

test-app/public/sinon.js:16933–16944  ·  view source on GitHub ↗

* Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.

(value, object)

Source from the content-addressed store, hash-verified

16931 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
16932 */
16933 function isKey(value, object) {
16934 if (isArray(value)) {
16935 return false;
16936 }
16937 var type = typeof value;
16938 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
16939 value == null || isSymbol(value)) {
16940 return true;
16941 }
16942 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
16943 (object != null && value in Object(object));
16944 }
16945
16946 /**
16947 * Checks if `value` is suitable for use as unique object key.

Callers 3

baseMatchesPropertyFunction · 0.85
castPathFunction · 0.85
propertyFunction · 0.85

Calls 2

isArrayFunction · 0.70
isSymbolFunction · 0.70

Tested by

no test coverage detected