-
-
Notifications
You must be signed in to change notification settings - Fork 8
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: make isFalsyType()
return true
for 0n
#545
fix: make isFalsyType()
return true
for 0n
#545
Conversation
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.
Unit tests are failing, could you fix those up please?
Looks like the issue is caused by an update to pnpm, to a version not compatible with the version of node we're using for the testing. #531 should fix this. |
I'm thinking it's best if I just wait with this PR until that gets merged then? |
Oh, I was looking at TypeScript 4.9.5 on https://github.com/JoshuaKGoldberg/ts-api-utils/actions/runs/11544117529/job/32131517301?pr=545:
#531 will drop support for TS <4.8, but I reproduce this issue on TS 4.8 and 4.9 locally. |
i'll take a look then! 👍 |
@all-contributors please add @kirkwaiblinger for code.
|
I've put up a pull request to add @kirkwaiblinger! 🎉 |
Adds @kirkwaiblinger as a contributor for code. This was requested by JoshuaKGoldberg [in this comment](#545 (comment)) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
PR Checklist
0n
#544status: accepting prs
Overview
The
type.value
returns aPseudoBigInt
object rather than an actual bigint for TS legacy support reasons. Therefore, to determine if a literal is a falsy value, we cannot rely on the truthiness oftype.value
alone, and need to check what the actual object is if it's not a primitive.