json-diff
json-diff copied to clipboard
Boolean diff report
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
@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}')
$