Closed denisnd closed 7 years ago
@denisnd Hey thanks for raising the issue! I've just published a fix in version 1.0.3 so if you try the same code again all should be good :smile:.
It will treat the object as a normal JS object that has the .hasOwnProperty
function available, this means that it will work on nested structures that are missing this property at any level.
var deepObjectDiff = require('deep-object-diff');
var a = Object.create(null);
a.foo = 'bar';
var b = Object.create(null);
b.foo = 'baz';
console.log( deepObjectDiff.diff(a, b) ); // { foo: 'baz' }
@mattphillips Thank you for quick fixing! Now everything is working fine.
I'm using deep-object-diff to compare objects generated by query-string. Structures returned by its parser have no hasOwnProperty method (https://github.com/sindresorhus/query-string/issues/47) and so deep-object-diff can't work on them as it relies on the method.
Steps to reproduce:
Error message: