Closed manishbhatias closed 4 years ago
Comparision of path for adjacent add + remove operation was broken when offset functionality was introduced
Test case
let jif = require('jiff'); let a = [1,2,3]; let b = [4,2,3]; console.log(jif.diff(a, b, {invertible:false}));
Result
Array (2 items) 0: Object {context: undefined, op: "add", path: "/0", value: 4} 1: Object {context: undefined, op: "remove", path: "/1"}
Expected Result
Array (1 item) 0: Object {context: undefined, op: "replace", path: "/0", value: 4}
Signed-off-by: Manish Bhatia manish@giveindia.org
Hi @manishbhatias, thanks for opening this PR! Could you also add a test case that shows the issue, i.e., a test that fails without your changes and passes with them. That'd be much appreciated.
Comparision of path for adjacent add + remove operation was broken when offset functionality was introduced
Test case
Result
Expected Result
Signed-off-by: Manish Bhatia manish@giveindia.org