flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

kaz138 opened this issue · comments

commented

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).

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