Open ihachani opened 6 years ago
Hey @ihachani thanks for the issue.
This is because those properties are non-enumerable, and deep-eql ignores non-enumerable properties. This is something we could perhaps change, but for now you can simple add enumerable: true
to your defineProperty
calls. Alternatively you could write a helper to handle these objects.
I added enumerable: true
and it is working now. May I ask why deep-eql ignores enumerables? What would I gain/lose when I set it to true. Thanks.
It was a design decision, somewhat arbitrary. It may change in the future. What you gain/lose can probably best be explained by MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable
I have an immutable data structure defined as follow:
Comparing to object instances with different values always returns true when it should return false.