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 some inputs, the diff shows an existing item in the list as added, and the new item as only having one field modified:
$ cat one.json [ { "key": "value1", "foo": "exists", "bar": "exists" } ] $ cat two.json [ { "key": "value2", "foo": "new", "bar": "new" }, { "key": "value2", "foo": "exists", "bar": "exists" } ] $ json-diff one.json two.json [ { - key: "value1" + key: "value2" } + { + key: "value2" + foo: "exists" + bar: "exists" + } ]
The diff above shows the { "key": "value2", "foo": "exists", "bar": "exists" } as being added, and fails to output the "new" string values at all.
{ "key": "value2", "foo": "exists", "bar": "exists" }
"new"
If the list items are reversed in two.json, the diff output is even more wrong:
two.json
$ cat one.json [ { "key": "value1", "foo": "exists", "bar": "exists" } ] $ cat two.json [ { "key": "value2", "foo": "exists", "bar": "exists" }, { "key": "value2", "foo": "new", "bar": "new" } ] $ json-diff one.json two.json [ { - key: "value1" + key: "value2" - foo: "exists" + foo: "new" - bar: "exists" + bar: "new" } + { + key: "value2" + foo: "new" + bar: "new" + } ]
In this case, it shows the existing item as being removed, and the new item as being added twice.
The text was updated successfully, but these errors were encountered:
feat: show object diffs in deepEqual errors
d8065c1
I'd like a prettier diff like the one from json-diff, but its array handling is fatally broken at the moment See: andreyvit/json-diff#18
This has been fixed in 0.6.0:
$ cat one.json two.json [ { "key": "value1", "foo": "exists", "bar": "exists" } ] [ { "key": "value2", "foo": "new", "bar": "new" }, { "key": "value2", "foo": "exists", "bar": "exists" } ] $ json-diff one.json two.json [ + { + key: "value2" + foo: "new" + bar: "new" + } { - key: "value1" + key: "value2" } ] $ json-diff two.json one.json [ - { - key: "value2" - foo: "new" - bar: "new" - } { - key: "value2" + key: "value1" } ]
Sorry, something went wrong.
No branches or pull requests
For some inputs, the diff shows an existing item in the list as added, and the new item as only having one field modified:
The diff above shows the
{ "key": "value2", "foo": "exists", "bar": "exists" }
as being added, and fails to output the"new"
string values at all.If the list items are reversed in
two.json
, the diff output is even more wrong:In this case, it shows the existing item as being removed, and the new item as being added twice.
The text was updated successfully, but these errors were encountered: