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

Remove dependency on deep-equal #10

Closed

Conversation

cloudrac3r
Copy link

node.js has a built-in util.isDeepStrictEqual since v9.0.0: https://nodejs.org/docs/latest-v21.x/api/assert.html#assertdeepstrictequalactual-expected-message

This is helpful because the deep-equal package has 50 dependencies, mostly ponyfills. We can make supertape have 34% fewer dependencies and 18% less installed filesize just by using the built in function instead of the deep-equal package.

However, this change makes it go from a loosely equal comparison to a strictly equal comparison, which could affect people's tests. (I had to fix one of mine that was expecting null but actually got undefined.) So a major version bump to v11 will be required.

@coderaiser
Copy link
Owner

coderaiser commented Mar 7, 2024

That's interesting idea! I should check this on my tests first, but yes we don't need any ponyfills since node v18 is the lowest version of node supported.

But I don't think we need a major version bump, case with null and undefined looks more like a bug to me.

@coderaiser
Copy link
Owner

coderaiser commented Mar 7, 2024

Merged as ebb9d46. Landed in v10.4.0 🎉 .

Thank you!

@coderaiser coderaiser closed this Mar 7, 2024
@cloudrac3r
Copy link
Author

Awesome, thanks!

@cloudrac3r cloudrac3r deleted the util-is-deep-strict-equal branch March 7, 2024 08:02
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.

2 participants