flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.
MIT License
2.99k stars 213 forks source link

Array position change only resulting in multiple DiffEdit events instead of DiffArray event #151

Closed kaz138 closed 5 years ago

kaz138 commented 5 years ago

I tested Deep-Diff on an array object that changes only the ordering of two elements, and result in multiple DiffEdit events each has a path that point to the position of the array where the change happened (instead of an DiffArray event).

Is this to be expected?

I did wish to see DiffArray event in this case because it would be easier to inteprete, since I filter to DiffArray kind for array fields currently, and this comes as a surprise that now I have to deal with the DiffEdit events but also multiple ones rather than one single diff object that has nested reports (like when adding / removing elements in the array).

flitbit commented 5 years ago

Duplicate of #37, #38, #100. I think we have enough reports on this; now I just need someone to PR a solution.