mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Remove isFunction use.
This commit is contained in:
@@ -6,7 +6,6 @@ import initCloneObject from './initCloneObject.js'
|
||||
import isArguments from '../isArguments.js'
|
||||
import isArrayLikeObject from '../isArrayLikeObject.js'
|
||||
import isBuffer from '../isBuffer.js'
|
||||
import isFunction from '../isFunction.js'
|
||||
import isObject from '../isObject.js'
|
||||
import isPlainObject from '../isPlainObject.js'
|
||||
import isTypedArray from '../isTypedArray.js'
|
||||
@@ -72,7 +71,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
||||
if (isArguments(objValue)) {
|
||||
newValue = toPlainObject(objValue)
|
||||
}
|
||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||
else if ((srcIndex && typeof objValue == 'function') || !isObject(objValue)) {
|
||||
newValue = initCloneObject(srcValue)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import isFunction from './isFunction.js'
|
||||
import isLength from './isLength.js'
|
||||
|
||||
/**
|
||||
@@ -25,7 +24,7 @@ import isLength from './isLength.js'
|
||||
* // => false
|
||||
*/
|
||||
function isArrayLike(value) {
|
||||
return value != null && isLength(value.length) && !isFunction(value)
|
||||
return value != null && typeof value != 'function' && isLength(value.length)
|
||||
}
|
||||
|
||||
export default isArrayLike
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import castPath from './.internal/castPath.js'
|
||||
import isFunction from './isFunction.js'
|
||||
import toKey from './.internal/toKey.js'
|
||||
|
||||
/**
|
||||
@@ -46,7 +45,7 @@ function result(object, path, defaultValue) {
|
||||
index = length
|
||||
value = defaultValue
|
||||
}
|
||||
object = isFunction(value) ? value.call(object) : value
|
||||
object = typeof value == 'function' ? value.call(object) : value
|
||||
}
|
||||
return object
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import arrayEach from './.internal/arrayEach.js'
|
||||
import baseForOwn from './.internal/baseForOwn.js'
|
||||
import isBuffer from './isBuffer.js'
|
||||
import isFunction from './isFunction.js'
|
||||
import isObject from './isObject.js'
|
||||
import isTypedArray from './isTypedArray.js'
|
||||
|
||||
@@ -44,7 +43,9 @@ function transform(object, iteratee, accumulator) {
|
||||
accumulator = isArr ? new Ctor : []
|
||||
}
|
||||
else if (isObject(object)) {
|
||||
accumulator = isFunction(Ctor) ? Object.create(Object.getPrototypeOf(object)) : {}
|
||||
accumulator = typeof Ctor == 'function'
|
||||
? Object.create(Object.getPrototypeOf(object))
|
||||
: {}
|
||||
}
|
||||
else {
|
||||
accumulator = {}
|
||||
|
||||
Reference in New Issue
Block a user