mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
722 B
24 lines
722 B
var baseTimes = require('./_baseTimes'),
|
|
isArguments = require('./isArguments'),
|
|
isArray = require('./isArray'),
|
|
isLength = require('./isLength'),
|
|
isString = require('./isString');
|
|
|
|
/**
|
|
* Creates an array of index keys for `object` values of arrays,
|
|
* `arguments` objects, and strings, otherwise `null` is returned.
|
|
*
|
|
* @private
|
|
* @param {Object} object The object to query.
|
|
* @returns {Array|null} Returns index keys, else `null`.
|
|
*/
|
|
function indexKeys(object) {
|
|
var length = object ? object.length : undefined;
|
|
if (isLength(length) &&
|
|
(isArray(object) || isString(object) || isArguments(object))) {
|
|
return baseTimes(length, String);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
module.exports = indexKeys;
|
|
|