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

refactor!: Remove json-bigint #566

Open
danielbankhead opened this issue Jun 28, 2023 · 0 comments
Open

refactor!: Remove json-bigint #566

danielbankhead opened this issue Jun 28, 2023 · 0 comments
Labels
next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. semver: major Hint for users that this is an API breaking change. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@danielbankhead
Copy link
Member

danielbankhead commented Jun 28, 2023

Remove json-bigint and @types/json-bigint.

We can use native bigints via the JSON.parse reviver parameter and essentially check via:

// JSON spec for number: https://www.json.org/json-en.html
const isInt = /^-?\d+(e(\+|\-)?\d+)?$/i.test(n);
const int = +n;

const value = Number.isSafeInteger(int) ? int : BigInt(n);

Documentation:

@danielbankhead danielbankhead added semver: major Hint for users that this is an API breaking change. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. next major: breaking change this is a change that we should wait to bundle into the next major version labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. semver: major Hint for users that this is an API breaking change. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant