fix: make isFalsyType() return true for 0n#545
Conversation
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
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 prsOverview
The
type.valuereturns aPseudoBigIntobject 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.valuealone, and need to check what the actual object is if it's not a primitive.