mattphillips / deep-object-diff

Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️

Home Page:https://www.npmjs.com/package/deep-object-diff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

an option to detect "inserted" and removed items in arrays

DetachHead opened this issue · comments

diff(['a', 'c', 'd', 'e'], ['a', 'b', 'c', 'd', 'e'])

the current behavior is to treat indexes 1, 2 and 3 as changed and 4 as added

{ '1': 'b', '2': 'c', '3': 'd', '4': 'e' }

it would be nice if it was able to detect that only one value was added. something like this:

{ inserts: { 1: 'b' } }

Duplicate?: #60 #79 #51

duplicate of #60 i guess