We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is the test case
var jsondiffpatch = require('jsondiffpatch').create({ objectHash: function(obj, index) { if (typeof obj.blockid !== 'undefined') { return obj.blockid; } return '$$index:' + index; }, arrays: { detectMove: true, includeValueOnMove: true } });
left.json
[ { "blockid": 1, "name": "Initialize", "blocks": [] }, { "blockid": 2, "name": "Self Service", "blocks": [ { "name": "Play Message D 2", "blockid": 30 }, { "name": "Menu_root_12_6", "blocks": [ { "name": "Menu_12_6", "blocks": [ { "name": "Play Message A 14", "blockid": 28 } ], "blockid": 10 }, { "name": "Menu_22_6", "blocks": [ { "name": "Play Message B 14", "blockid": 26 } ], "blockid": 11 } ], "blockid": 9 }, { "name": "Menu_root", "blocks": [ { "name": "Menu Option 1", "blocks": [ { "name": "Play Message y 3", "blockid": 47 } ], "blockid": 34 }, { "name": "Menu Option 2", "blocks": [ { "name": "Play Message x 3", "blockid": 46 } ], "blockid": 35 } ], "blockid": 33 } ] } ]
right.json
[ { "blockid": 1, "name": "Initialize", "blocks": [] }, { "blockid": 2, "name": "Self Service", "blocks": [ { "name": "Play Message D 2", "blockid": 30 }, { "name": "Play Message y 3", "blockid": 47 }, { "name": "Menu_root_12_6", "blocks": [ { "name": "Menu_12_6", "blocks": [ { "name": "Play Message A 14", "blockid": 28 } ], "blockid": 10 }, { "name": "Menu_22_6", "blocks": [ { "name": "Play Message B 14", "blockid": 26 } ], "blockid": 11 } ], "blockid": 9 }, { "name": "Menu_root", "blocks": [ { "name": "Menu Option 1", "blocks": [], "blockid": 34 }, { "name": "Menu Option 2", "blocks": [ { "name": "Play Message x 3", "blockid": 46 } ], "blockid": 35 } ], "blockid": 33 } ] } ]
delta
{ "1": { "blocks": { "1": [ { "name": "Play Message y 3", "blockid": 47 } ], "3": { "blocks": { "0": { "blocks": { "_t": "a", "_0": [ { "name": "Play Message y 3", "blockid": 47 }, 0, 0 ] } }, "_t": "a" } }, "_t": "a" } }, "_t": "a" }
In the delta, the path, "1" - "blocks" - "3" - ... doesn't exist in left.json or right.json. I think it's expected to be "1" - "blocks" - "2" - ...
The text was updated successfully, but these errors were encountered:
I've also encountered this issue 4 months ago.
A simpler test case is this one : left.json: [0, 1]
[0, 1]
right.json: [1, 3]
[1, 3]
delta: { "1": [ 3 ], "_t": "a", "_0": [ 0, 0, 0 ] }
{ "1": [ 3 ], "_t": "a", "_0": [ 0, 0, 0 ] }
The "1" totally disappear from the delta. If you try it on the demo page, you select the "Visual" with "Show unchanged values", the "1" doesn't show.
The workaround is to resort the right.json putting the old values in the same index as they were before.
Sorry, something went wrong.
No branches or pull requests
Here is the test case
left.json
right.json
delta
In the delta, the path, "1" - "blocks" - "3" - ... doesn't exist in left.json or right.json. I think it's expected to be "1" - "blocks" - "2" - ...
The text was updated successfully, but these errors were encountered: