Skip to content
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

fix: data comparison with undefined object values #2049

Merged
merged 4 commits into from Jul 27, 2020

Conversation

mastermatt
Copy link
Member

Updates the dataEqual utility and underlying deepEqual recursive functions to treat explicit and implicit undefined object values as equal.
Also ensures that expand is only called on top-level data if they're plain objects, thus avoiding accidentally equating an object and any array if the object's keys happen to be integers.

Fixes: #2048

Updates the `dataEqual` utility and underlying `deepEqual` recursive functions to treat explicit and implicit `undefined` object values as equal.
Also ensures that `expand` is only called on top-level data if they're plain objects, thus avoiding accidentally equating an object and any array if the object's keys happen to be integers.
tests/test_common.js Outdated Show resolved Hide resolved
@MichaelBuhler
Copy link

Commenting here to confirm here that this PR (6d654a2) fixes the production use case which caused me to file #2048.

@mastermatt mastermatt requested a review from a team July 18, 2020 19:22
@MichaelBuhler
Copy link

@mastermatt any update on this?

@mastermatt
Copy link
Member Author

I think it's good to go, but needs an approval from one of the other @nock/maintainers

Copy link
Member

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! :shipit:

@mastermatt mastermatt merged commit ac6ebbb into nock:main Jul 27, 2020
@mastermatt mastermatt deleted the 2048/fix-data-comparison branch July 27, 2020 16:53
@github-actions
Copy link

🎉 This PR is included in version 13.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected behavior in current deepEqual function
3 participants