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

Function isKey

lib/web/jshint.js:5661–5671  ·  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

5659 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
5660 */
5661 function isKey(value, object) {
5662 var type = typeof value;
5663 if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
5664 return true;
5665 }
5666 if (isArray(value)) {
5667 return false;
5668 }
5669 var result = !reIsDeepProp.test(value);
5670 return result || (object != null && value in toObject(object));
5671 }
5672
5673 /**
5674 * Checks if `func` has a lazy counterpart.

Callers 7

baseMatchesPropertyFunction · 0.85
invokePathFunction · 0.85
runInContextFunction · 0.85
hasFunction · 0.85
resultFunction · 0.85
setFunction · 0.85
propertyFunction · 0.85

Calls 3

isArrayFunction · 0.70
toObjectFunction · 0.70
testMethod · 0.45

Tested by

no test coverage detected