Skip to content
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

BigInt 0n Throws Error #154

Closed
WilsontheWolf opened this issue Dec 14, 2022 · 2 comments · Fixed by #156
Closed

BigInt 0n Throws Error #154

WilsontheWolf opened this issue Dec 14, 2022 · 2 comments · Fixed by #156

Comments

@WilsontheWolf
Copy link

The BigInt 0n throws an error when serializing, unlike every other BigInt.

image

@momocow
Copy link
Contributor

momocow commented Jan 11, 2023

I found this is because 0n evaluates true in this if clause and the original value (as a bigint) is returned directly.

if (!value && value !== undefined) {
return value;
}

I'm not really sure what is the intention of this check.

momocow added a commit to momocow/serialize-javascript that referenced this issue Jan 12, 2023
okuryu pushed a commit that referenced this issue Jan 15, 2023
@okuryu
Copy link
Collaborator

okuryu commented Jan 15, 2023

published v6.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants