mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 20:07:49 +00:00
Remove isIterateeCall.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import baseRange from './baseRange.js'
|
||||
import isIterateeCall from './isIterateeCall.js'
|
||||
import toFinite from '../toFinite.js'
|
||||
|
||||
/**
|
||||
@@ -11,9 +10,6 @@ import toFinite from '../toFinite.js'
|
||||
*/
|
||||
function createRange(fromRight) {
|
||||
return (start, end, step) => {
|
||||
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
|
||||
end = step = undefined
|
||||
}
|
||||
// Ensure the sign of `-0` is preserved.
|
||||
start = toFinite(start)
|
||||
if (end === undefined) {
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import eq from '../eq.js'
|
||||
import isArrayLike from '../isArrayLike.js'
|
||||
import isIndex from './isIndex.js'
|
||||
import isObject from '../isObject.js'
|
||||
|
||||
/**
|
||||
* Checks if the given arguments are from an iteratee call.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The potential iteratee value argument.
|
||||
* @param {*} index The potential iteratee index or key argument.
|
||||
* @param {*} object The potential iteratee object argument.
|
||||
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
||||
* else `false`.
|
||||
*/
|
||||
function isIterateeCall(value, index, object) {
|
||||
if (!isObject(object)) {
|
||||
return false
|
||||
}
|
||||
const type = typeof index
|
||||
if (type == 'number'
|
||||
? (isArrayLike(object) && isIndex(index, object.length))
|
||||
: (type == 'string' && index in object)
|
||||
) {
|
||||
return eq(object[index], value)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export default isIterateeCall
|
||||
Reference in New Issue
Block a user