-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
chore(generic): add more falsy values #14320
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
Conversation
d12b7d6
to
2d27a27
Compare
Any reason not to follow https://developer.mozilla.org/en-US/docs/Glossary/Falsy ? Apart from |
I prefer using rebase for cleaner commit details, including squash. |
You can take a look at the description, it was giving some alternative values for falsy/falsey too. I wish we can add more falsy values to prevent non-truthy values being not passed by typescript. |
Updated the PR description for the changes goals. |
2e1e373
to
66ee23c
Compare
Apparently there was a reason to not add NaN here; #13763 (comment) |
It was actually discussed in here too microsoft/TypeScript#28682 but it was still feasible to add it yet, there is some mathematical operation are returning |
falsy/falsey means internal toBoolean returns false for the values 0.0 | -0.0 : any zeroish number return false 0x0 | -0x0 : represent hex number of 0 NaN : Not a Number --- **new falsy values on ES2020** 0x0n | -0x0n : the bigint of zero and negative zero, alongside 0n and -0n ---
0b69fba
to
05c7d7e
Compare
Since there are no |
Closed this PR, this PR should be future notes also |
Prevent another non-truthy values being not passed by typescript.