* Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names.
(value, inherited)
| 78057 | * @returns {Array} Returns the array of property names. |
| 78058 | */ |
| 78059 | function arrayLikeKeys(value, inherited) { |
| 78060 | var isArr = isArray(value), |
| 78061 | isArg = !isArr && isArguments(value), |
| 78062 | isBuff = !isArr && !isArg && isBuffer(value), |
| 78063 | isType = !isArr && !isArg && !isBuff && isTypedArray(value), |
| 78064 | skipIndexes = isArr || isArg || isBuff || isType, |
| 78065 | result = skipIndexes ? baseTimes(value.length, String) : [], |
| 78066 | length = result.length; |
| 78067 | |
| 78068 | for (var key in value) { |
| 78069 | if ((inherited || hasOwnProperty.call(value, key)) && |
| 78070 | !(skipIndexes && ( |
| 78071 | // Safari 9 has enumerable `arguments.length` in strict mode. |
| 78072 | key == 'length' || |
| 78073 | // Node.js 0.10 has enumerable non-index properties on buffers. |
| 78074 | (isBuff && (key == 'offset' || key == 'parent')) || |
| 78075 | // PhantomJS 2 has enumerable non-index properties on typed arrays. |
| 78076 | (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || |
| 78077 | // Skip index properties. |
| 78078 | isIndex(key, length) |
| 78079 | ))) { |
| 78080 | result.push(key); |
| 78081 | } |
| 78082 | } |
| 78083 | return result; |
| 78084 | } |
| 78085 | |
| 78086 | module.exports = arrayLikeKeys; |
| 78087 |
no test coverage detected
searching dependent graphs…