node-deep-extend icon indicating copy to clipboard operation
node-deep-extend copied to clipboard

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

Open Leon2xiaowu opened this issue 4 years ago • 0 comments

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}]}?

Leon2xiaowu avatar Jun 26 '21 14:06 Leon2xiaowu