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
For the following two similar objects
a = [ {key: 'a', value: '0'}, {key: 'BUG', value: ''}, {key: 'c', value: '1'}, {key: 'd', value: '2'}, {key: 'e', value: '3'}, {key: 'f', value: '4'}, {key: 'g', value: '5'}, {key: 'BUG', value: ''} ] b = [ {key: 'a', value: '0'}, {key: 'BUG', value: ''}, {key: 'c', value: '1'}, {key: 'd', value: '2'}, {key: 'e', value: '3'}, {key: 'f', value: '4'}, {key: 'g', value: '5'}, {key: 'BUG', value: ''} ]
JsonDiff.diff(a, b) returns the following diff
JsonDiff.diff(a, b)
[{"op"=>"move", "from"=>"/7", "path"=>"/1"}, {"op"=>"move", "from"=>"/2", "path"=>"/7"}]
which is replacing the similar lines with each other.
Strangely, if we remove any of the a/c/d/e/f/g lines in both objects, the bug isn't there anymore, e.g.
a = [ {key: 'BUG', value: ''}, {key: 'c', value: '1'}, {key: 'd', value: '2'}, {key: 'e', value: '3'}, {key: 'f', value: '4'}, {key: 'g', value: '5'}, {key: 'BUG', value: ''} ] b = [ {key: 'BUG', value: ''}, {key: 'c', value: '1'}, {key: 'd', value: '2'}, {key: 'e', value: '3'}, {key: 'f', value: '4'}, {key: 'g', value: '5'}, {key: 'BUG', value: ''} ] JsonDiff.diff(a, b) => []
The text was updated successfully, but these errors were encountered:
PS. Found with json-diff 0.4.1
Sorry, something went wrong.
No branches or pull requests
For the following two similar objects
JsonDiff.diff(a, b)
returns the following diffwhich is replacing the similar lines with each other.
Strangely, if we remove any of the a/c/d/e/f/g lines in both objects, the bug isn't there anymore, e.g.
The text was updated successfully, but these errors were encountered: