-
Notifications
You must be signed in to change notification settings - Fork 21
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 usage of assert.invariant
#298
Remove usage of assert.invariant
#298
Conversation
Hello! Thanks for taking the time to contribute. Instead of inlining these checks, how do you feel about creating a helper function that broadly matches the signature of |
@steelbrain , sure, no problem with that. I saw there were only a few of them, but maybe it's more elegant to have a helper function. |
51d8735
to
80fd44d
Compare
@steelbrain , done.
|
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.
Thank you for working on this, minor nit and then we're good
80fd44d
to
d640767
Compare
Apparently the EDIT: It was the linter, apparently I did not notice that the project does not use semicolons. |
This reduces dependencies when building for the browser target, since the assert module is a Node.js dependency.
d640767
to
6981e32
Compare
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.
Thanks again!
I was using
php-serialize
at client level using Svelte and Vite, when it warned me at build time:Apparently this is due to the fact that
assert
is a Node module, so it has to embed this module to work in the browser.I've looked at the uses of
invariant
in the code base and they are only a few, so I thought about replacing them with simple guard statements instead.