How to use the exclude option in ES5 or ES6
BIPLAVGHOSAL opened this issue · 2 comments
BIPLAVGHOSAL commented
the -exclude-keys
-x
is working fine from CLI, but not able to use in ES5 or ES6, can someone please suggest?
CLI Usage:
a.json
{
"foo": "bar"
}
b.json
{
"foo": "baz"
}
works fine: json-diff -x foo a.json b.json
in ES5 :
const { diff } = require('json-diff');
const a = diff({ foo: 'bar' }, { foo: 'baz' }, {PLEAE SUGGEST WHAT TO PASS}) //no variables available , I guess
ewoudenberg commented
@BIPLAVGHOSAL it's
const a = diff({ foo: 'bar' }, { foo: 'baz' }, {excludeKeys: ['foo']})
BIPLAVGHOSAL commented
Thanks a lot @ewoudenberg