You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using deep-object-diff to compare objects generated by query-string. Structures returned by its parser have no hasOwnProperty method (sindresorhus/query-string#47) and so deep-object-diff can't work on them as it relies on the method.
Steps to reproduce:
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) );
Error message:
TypeError: rhs.hasOwnProperty is not a function
at C:\Users\nd\object-diff\node_modules\deep-object-diff\dist\diff\index.js:55:18
The text was updated successfully, but these errors were encountered:
@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 😄.
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.
I'm using deep-object-diff to compare objects generated by query-string. Structures returned by its parser have no hasOwnProperty method (sindresorhus/query-string#47) and so deep-object-diff can't work on them as it relies on the method.
Steps to reproduce:
Error message:
The text was updated successfully, but these errors were encountered: