MCPcopy Create free account
hub / github.com/RubyLouvre/anu / isKey

Function isKey

test/babel.js:21952–21961  ·  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

21950 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
21951 */
21952 function isKey(value, object) {
21953 if (isArray(value)) {
21954 return false;
21955 }
21956 var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
21957 if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
21958 return true;
21959 }
21960 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
21961 }
21962
21963 module.exports = isKey;
21964

Callers 3

castPathFunction · 0.85
baseMatchesPropertyFunction · 0.85
propertyFunction · 0.85

Calls 2

isArrayFunction · 0.85
isSymbolFunction · 0.70

Tested by

no test coverage detected