TehShrike / deepmerge

A library for deep (recursive) merging of Javascript objects
MIT License
2.75k stars 216 forks source link

When merging arrays the target defaults to empty array #264

Open nejcm opened 7 months ago

nejcm commented 7 months ago

I am trying to merge two array inside an object but would like to set it to fallback to source in case the target is undefined. Currently this is not doable because the target value in that case always defaults to an empty array.

This change would probably be breaking so it would be good to at least know the original value as the last additional parameter of the arrayMerge fn.