-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
jiff.diff({
"a": {
"b": {
"c": [ ["a"], ["b"], ["c"] ]
}
}
}, {
"a": {
"b": {
"c": [ ["a"], ["b"], ["c"] ]
}
}
});
Produces the following patch:
[ { op: 'add',
path: '/a/b/c/0',
value: [ 'a' ],
context: undefined },
{ op: 'add',
path: '/a/b/c/1',
value: [ 'b' ],
context: undefined },
{ op: 'add',
path: '/a/b/c/2',
value: [ 'c' ],
context: undefined },
{ op: 'test',
path: '/a/b/c/3',
value: [ 'a' ],
context: undefined },
{ op: 'remove', path: '/a/b/c/3', context: undefined },
{ op: 'test',
path: '/a/b/c/3',
value: [ 'b' ],
context: undefined },
{ op: 'remove', path: '/a/b/c/3', context: undefined },
{ op: 'test',
path: '/a/b/c/3',
value: [ 'c' ],
context: undefined },
{ op: 'remove', path: '/a/b/c/3', context: undefined } ]
Which is correct, in the sense that applying the patch will yield the correct result; but not efficient, as the patch could simply be empty.
Metadata
Metadata
Assignees
Labels
No labels