json-diff-ts
json-diff-ts copied to clipboard
Added key value with value "undefined"
Hi there,
A simple question about the following example :
const { diff } = require('json-diff-ts');
const a = { bubu: 'bubu', newProp: undefined }
const b = { bubu: 'bubu' }
console.log(diff(b, a))
[ { type: 'ADD', key: 'newProp', value: undefined } ]
Is there a way to treat this case as "nothing changed" ?
I sometimes set some values to undefined in order to remove them from an object, so in this case diff tells me there is an update but my final objects are the same.