mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Bump to v4.0.0.
This commit is contained in:
22
internal/indexKeys.js
Normal file
22
internal/indexKeys.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import baseTimes from './baseTimes';
|
||||
import isArguments from '../isArguments';
|
||||
import isArray from '../isArray';
|
||||
import isLength from '../isLength';
|
||||
import isString from '../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;
|
||||
return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
|
||||
? baseTimes(length, String)
|
||||
: null;
|
||||
}
|
||||
|
||||
export default indexKeys;
|
||||
Reference in New Issue
Block a user