mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
committed by
John-David Dalton
parent
b37e973463
commit
f5b2031211
@@ -1,5 +1,4 @@
|
|||||||
import arrayEach from './.internal/arrayEach.js'
|
import arrayEach from './.internal/arrayEach.js'
|
||||||
import baseCreate from './.internal/baseCreate.js'
|
|
||||||
import baseForOwn from './.internal/baseForOwn.js'
|
import baseForOwn from './.internal/baseForOwn.js'
|
||||||
import isBuffer from './isBuffer.js'
|
import isBuffer from './isBuffer.js'
|
||||||
import isFunction from './isFunction.js'
|
import isFunction from './isFunction.js'
|
||||||
@@ -45,7 +44,7 @@ function transform(object, iteratee, accumulator) {
|
|||||||
accumulator = isArr ? new Ctor : []
|
accumulator = isArr ? new Ctor : []
|
||||||
}
|
}
|
||||||
else if (isObject(object)) {
|
else if (isObject(object)) {
|
||||||
accumulator = isFunction(Ctor) ? baseCreate(Object.getPrototypeOf(object)) : {}
|
accumulator = isFunction(Ctor) ? Object.create(Object.getPrototypeOf(object)) : {}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
accumulator = {}
|
accumulator = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user