This modification is based on the work done in https://github.com/flitbit/diff/pull/101. I added logic to remove common objects between array to make sure a deletion result in 1 deletion change instead of numerous edition and 1 deletion. Ex:
lhs = [1,2,3,4]
rhs= [2,3,4]
should give [DiffArray{index: 0, item: DiffDeleted { lhs=1}}]
and not [DiffEdit{lhs: 2, rhs:1}, DiffEdit{lhs: 3, rhs:2}, DiffEdit{lhs: 4, rhs:3}, DiffArray{index: 3, item: DiffDeleted { lhs=4}}]
This modification is based on the work done in https://github.com/flitbit/diff/pull/101. I added logic to remove common objects between array to make sure a deletion result in 1 deletion change instead of numerous edition and 1 deletion. Ex: lhs = [1,2,3,4] rhs= [2,3,4]
should give [DiffArray{index: 0, item: DiffDeleted { lhs=1}}] and not [DiffEdit{lhs: 2, rhs:1}, DiffEdit{lhs: 3, rhs:2}, DiffEdit{lhs: 4, rhs:3}, DiffArray{index: 3, item: DiffDeleted { lhs=4}}]