UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

19 lines (18 loc) 1.05 kB
import baseTimes from "./_baseTimes.mjs"; import isArguments from "./isArguments.mjs"; import isArray from "./isArray.mjs"; import isBuffer from "./isBuffer.mjs"; import isIndex from "./_isIndex.mjs"; import isTypedArray from "./isTypedArray.mjs"; var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) { result.push(key); } } return result; } export { arrayLikeKeys as default };