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

Adding Support for the JSON BigInt Parsing - Update the JSON.parse to JSONBig.parse #54

Open
amithaswar opened this issue Jan 15, 2025 · 1 comment

Comments

@amithaswar
Copy link

https://www.npmjs.com/package/json-bigint
Having issues with showing the BigInt on the Json View. The value is getting converted to Float and then it is losing the precision for the last 3 digits making the last 3 digits as 000

{ "value" : 9223372036854775807}, for example, is still a valid RFC4627 JSON string, and in most JS runtimes the result of JSON.parse is this object: { value: 9223372036854776000 }

@Kikobeats
Copy link
Member

I believe that's happening because BigInt is outside the JSON.parse specification.

This function needs to be modified to support BigInt properly:

export default function parseInput (input) {

Unfortunately, I can't work on this right now, but I'll be happy to accept a PR fixing this 🙂

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

2 participants