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

Function shimKeys

lib/web/jshint.js:5919–5938  ·  view source on GitHub ↗

* A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names.

(object)

Source from the content-addressed store, hash-verified

5917 * @returns {Array} Returns the array of property names.
5918 */
5919 function shimKeys(object) {
5920 var props = keysIn(object),
5921 propsLength = props.length,
5922 length = propsLength && object.length,
5923 support = lodash.support;
5924
5925 var allowIndexes = length && isLength(length) &&
5926 (isArray(object) || (support.nonEnumArgs && isArguments(object)));
5927
5928 var index = -1,
5929 result = [];
5930
5931 while (++index < propsLength) {
5932 var key = props[index];
5933 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
5934 result.push(key);
5935 }
5936 }
5937 return result;
5938 }
5939
5940 /**
5941 * Converts `value` to an array-like object if it is not one.

Callers 1

runInContextFunction · 0.85

Calls 7

keysInFunction · 0.85
isLengthFunction · 0.85
isArgumentsFunction · 0.85
isIndexFunction · 0.85
isArrayFunction · 0.70
callMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected