-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support non plain objects #179
support non plain objects #179
Conversation
I tried to add an integration test with
Edit: |
Yes! |
@vzaidman Updated the PR. Some thoughts:
|
src/calculateDeepEqualDiffs.js
Outdated
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different); | ||
} | ||
// Do not compare the stack as it might differ even though the errors are identical. | ||
const relevantKeys = keys.filter(k => k !== 'stack'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move the relevantKeys
calculation in to the
if (typeof a === 'object' && typeof b === 'object' && Object.getPrototypeOf(a) === Object.getPrototypeOf(b)) {
scope
so we won't repeat the rest of the code.
|
Sorry it took so long to merge |
Now I get following warnings, apparently because WDYR tries to access a prop that shouldn't be accessed:
Let's maybe ignore the properties with getters? |
In what cases do you see this? |
@Hypnosphi hey! how can i reproduce it? |
Sorry I missed your previous comment. I'll create a reproduction case |
Here's the minimal reproduction: |
fixed in v6.1.1 |
Added non plain object detection:
Wasn't sure why there's a copy of the object before sending it to
trackDiff
(introduced here).This broke for non plain objects, so I passed the object without clone in case it's not a plain one. Open for other suggestions here :)
This PR fixes #74