-
Notifications
You must be signed in to change notification settings - Fork 13
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
How to use unassert? #10
Comments
Hi @serapath, thank you for your question! First I have to say that assertions are NOT drop-in replacement for Errors. Let's see these quotes. Quotes
Therefore, I do not recommend you to use assertions in public APIs. Well-documented Errors are better. unassert usersNow let's see real world examples.
choo author yoshua also wrote a tiny guide to non fancy, high-value Node.js things
If you have any questions, please feel free to ask me again. Thanks! |
I'm already planning for quite some time to practice to code with assertions to later use unassert to get rid of them.
Currently I imagine, that in an ideal scenario, i want to remove all uses
assert
but maybe not the ones that are exposes as an API to users. Given valid inputs to whatever the API is, all internal libraries should work correctly, because of assert, but given incorrect API inputs, things might break when asserts are removed.But then again - even if only a single assert remains, it will pull in assert as a dependency, which is not really desirable when using the result in the browser.
Is that correct?
Can you recommend some tutorials/howtos and/or nice examples how to get started?
The text was updated successfully, but these errors were encountered: