Files
lodash/_indexKeys.js
John-David Dalton 35cdf6513b Bump to v4.13.0.
2016-05-22 19:35:24 -07:00

25 lines
720 B
JavaScript

import baseTimes from './_baseTimes.js';
import isArguments from './isArguments.js';
import isArray from './isArray.js';
import isLength from './isLength.js';
import isString from './isString.js';
/**
* 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;
}
export default indexKeys;