mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Remove baseTimes.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import baseTimes from './baseTimes.js'
|
||||
import isArguments from '../isArguments.js'
|
||||
import isBuffer from '../isBuffer.js'
|
||||
import isIndex from './isIndex.js'
|
||||
@@ -21,9 +20,12 @@ function arrayLikeKeys(value, inherited) {
|
||||
const isBuff = !isArr && !isArg && isBuffer(value)
|
||||
const isType = !isArr && !isArg && !isBuff && isTypedArray(value)
|
||||
const skipIndexes = isArr || isArg || isBuff || isType
|
||||
const result = skipIndexes ? baseTimes(value.length, String) : []
|
||||
const length = result.length
|
||||
|
||||
const length = value.length
|
||||
const result = new Array(skipIndexes ? length : 0)
|
||||
let index = skipIndexes ? -1 : length
|
||||
while (++index < length) {
|
||||
result[index] = `${ index }`
|
||||
}
|
||||
for (const key in value) {
|
||||
if ((inherited || hasOwnProperty.call(value, key)) &&
|
||||
!(skipIndexes && (
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* The base implementation of `times` without support for max array length checks.
|
||||
*
|
||||
* @private
|
||||
* @param {number} n The number of times to invoke `iteratee`.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the array of results.
|
||||
*/
|
||||
function baseTimes(n, iteratee) {
|
||||
let index = -1
|
||||
const result = Array(n)
|
||||
|
||||
while (++index < n) {
|
||||
result[index] = iteratee(index)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export default baseTimes
|
||||
Reference in New Issue
Block a user