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