Closed dvlin-dev closed 2 years ago
in "jsondiffpatch": "^0.4.1"
when i diff a and b, it is not successful.
const {diff} = require("jsondiffpatch"); const a = '[{"attr":"model","op":"in","val":["apple"]},{"attr":"version"}]' const b = '[{"attr":"env","op":"in","val":["office"]},{"attr":"version"}]' console.log(diff(a,b));
[ '@@ -7,13 +7,11 @@\n' + ' r%22:%22\n' + '-model\n' + '+env\n' + ' %22,%22o\n' + '@@ -30,12 +30,13 @@\n' + ' %22:%5B%22\n' + '-appl\n' + '+offic\n' + ' e%22%5D%7D\n', 0, 2 ]
but ,just change the string, successful !!
const {diff} = require("jsondiffpatch"); const a = '[{"attr":"model","op":"in","val":["apple"]},{"attr":"1"}]' const b = '[{"attr":"env","op":"in","val":["office"]},{"attr":"version"}]' console.log(diff(a,b));
[ '[{"attr":"model","op":"in","val":["apple"]},{"attr":"1"}]', '[{"attr":"env","op":"in","val":["office"]},{"attr":"version"}]' ]
in "jsondiffpatch": "^0.4.1"
when i diff a and b, it is not successful.
but ,just change the string, successful !!