flitbit / diff

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

duplicate path when diff array of object property #124

Closed shenrenguo closed 6 years ago

shenrenguo commented 6 years ago

left = { key: [ {A: 0, B: 1}, {A: 2, B: 3} ] } right = { key: [ {A: 9, B: 1}, {A: 2, B: 3} ] }

r = diff(left, right) only one changes occurred, but the output difference have 3: {kind: 'E', path: ['key', 0, 'A'], lhs: 0, rhs: 9} {kind: 'E', path: ['key.0', 'A'], lhs: 0, rhs: 9} {kind: 'E', path: ['key.0.A'], lhs: 0, rhs: 9}

flitbit commented 6 years ago

Added a script that shows this is not an issue: look at issue-124.js... if you still have issues, please tell me more about your environment, versions, etc.