unclechu / node-deep-extend

Recursive extend module
MIT License
202 stars 53 forks source link

The output of the exception when merging Array[<Object>] #47

Open Leon2xiaowu opened 3 years ago

Leon2xiaowu commented 3 years ago

when I ran the following code, I was surprised by the result


const target = {}
deepExtend(
  target,
  {
    series: [{ center: [1, 2], other: 1, dif: 2 }]
  },
  { series: [{ center: [3, 4] }] }
)
console.log(target, 'reuslt')

this outputs {"series":[{"center":[3,4]}]}.

Shouldn't the correct result be {"series":[{"center":[3,4],"other": 1,"dif": 2}]}?