Skip to content
New issue

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

Boolean diff report #96

Open
reharik opened this issue Oct 19, 2022 · 1 comment
Open

Boolean diff report #96

reharik opened this issue Oct 19, 2022 · 1 comment

Comments

@reharik
Copy link

reharik commented Oct 19, 2022

Is there a way or can there be a way to get a boolean result from the diff, or perhaps, if there are no differences return a single empty object or string? I'm trying to run this on a bunch of documents from the db and have a result that is filtered by hasDiff. Right now I have to sort of iterate over everything and check if there's anything in each of the objects.
Thanks,
Raif

@ewoudenberg
Copy link
Collaborator

@reharik -- As designed, this returns an empty result when there is no difference. Can you provide the simplest example of the two objects you are diffing that show output when identical?

example:

$ ./bin/json-diff.js --raw-json <(echo '{"a":4, "b":6}') <(echo '{"a":5,"b":6}')
{
  "a": {
    "__old": 4,
    "__new": 5
  }
}
$ ./bin/json-diff.js --raw-json <(echo '{"a":4, "b":6}') <(echo '{"a":4,"b":6}')
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants