We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>>> JSON.parse('1234567834982342349e100') 1.2345678349823424e+118 >>> require('json-bigint').parse('1234567834982342349e100') BigNumber { s: 1, e: 118, c: [ 1234567, 83498234234900 ] } >>> require('json-bigint')({ useNativeBigInt: true }).parse('1234567834982342349e100') Thrown: SyntaxError: Cannot convert 1234567834982342349e100 to a BigInt
This only affects numbers in scientific notation where the string is longer than 14 characters, per
json-bigint/lib/parse.js
Line 211 in 390482a
>>> JSON.parse('12345679e2') 1234567900 >>> require('json-bigint').parse('12345679e2') 1234567900 >>> require('json-bigint')({ useNativeBigInt: true }).parse('12345679e2') 1234567900
It would be nice if the following property held (written using the fast-check library)
fast-check
fc.assert( fc.property(fc.jsonObject(), (v) => { JSONbig.parse(JSONbig.stringify(v)) }) )
which currently fails
Thrown: Error: Property failed after 16 tests { seed: -424944911, path: "15:1:0:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0", endOnFailure: true } Counterexample: [{"":1.1102230246251565e-16}] Shrunk 29 time(s) Got error: SyntaxError: Cannot convert 1.1102230246251565e-16 to a BigInt
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
This only affects numbers in scientific notation where the string is longer than 14 characters, per
json-bigint/lib/parse.js
Line 211 in 390482a
It would be nice if the following property held (written using the
fast-check
library)which currently fails
The text was updated successfully, but these errors were encountered: