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

Plain numbers are incorrectly parsed as BigInt #63

Open
edtz opened this issue Sep 13, 2021 · 2 comments
Open

Plain numbers are incorrectly parsed as BigInt #63

edtz opened this issue Sep 13, 2021 · 2 comments

Comments

@edtz
Copy link

edtz commented Sep 13, 2021

Supposedly, everything lower or equal to Number.MAX_SAFE_INTEGER should be 'number', but it's not the case. Here's repro:

import JsonBigInt from "json-bigint";

const { parse } = JsonBigInt({
    protoAction: "ignore",
    useNativeBigInt: true,
});

console.log(parse(JSON.stringify({ foo: Number.MAX_SAFE_INTEGER, bar: 100 })));

yields { foo: 9007199254740991n, bar: 100 }, should be { foo: 9007199254740991, bar: 100 }

@fyyhome
Copy link

fyyhome commented Jun 8, 2022

Does this issue be resolved? I'm using version 1.0.0 and still got this issue

@edtz
Copy link
Author

edtz commented Jun 9, 2022

This issue is resolved inside the repo after this commit, but for some reason author doesn't seem too interested to publish it on npm.

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