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

Error parsing string with useNativeBigInt mode #88

Open
hdoan741 opened this issue Aug 2, 2023 · 11 comments
Open

Error parsing string with useNativeBigInt mode #88

hdoan741 opened this issue Aug 2, 2023 · 11 comments

Comments

@hdoan741
Copy link

hdoan741 commented Aug 2, 2023

It seems the parser is incorrect when parsing fractional number:

> jsbi({useNativeBigInt: true}).parse('-0.3333333333333333')
Uncaught SyntaxError: Cannot convert -0.3333333333333333 to a BigInt
@victorkirov
Copy link

I don't think this is an error. You can't parse a decimal into a bigint in JS. You should probably only be using useNativeBigInt: true if you're 100% sure that your payload won't have decimals in it.

@mois-ilya
Copy link

mois-ilya commented Aug 6, 2024

This issue was fixed in this PR 3530541. However, the latest version on npm was released before this fix. To use the updated version, I temporarily added the package like this in my project:

    "dependencies": {
        "json-bigint": "github:sidorares/json-bigint#8208aa1352eba252b60756672ab7c17f300d6ccd"
    }

@nathanmmiller
Copy link

@sidorares any chance a 1.0.1 could be released with the changes from the PR mentioned above by @mois-ilya ?

@sidorares
Copy link
Owner

hey @nathanmmiller I'm on vacations this week and hope to finally give issues in this repo some attention. I plan to setup release-please, once added all merged changes should be immediately published

@nathanmmiller
Copy link

Amazing, thank you @sidorares - I think I may have another weird edge case but don't want to raise an issue (or PR) until I know the updated code doesn't fix it. I look forward!

@nathanmmiller
Copy link

hey @nathanmmiller I'm on vacations this week and hope to finally give issues in this repo some attention. I plan to setup release-please, once added all merged changes should be immediately published

Any chance this is coming soon? Thanks!

@SkylerLutz
Copy link

@sidorares can you release this please?

@SkylerLutz
Copy link

@sidorares can you please release this?

@flbn
Copy link

flbn commented Nov 1, 2024

can we please make a new release? lib has been stale on npm for years now :|

@nathanmmiller
Copy link

I think this is abandonware at this point. Is anyone using alternatives and if so, what?

If not, @sidorares would you prefer someone else take over this library?

@scastrec
Copy link

scastrec commented Feb 5, 2025

Hi,
Will a new version be published ?
Thanks

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

No branches or pull requests

8 participants