We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20a4f10 commit 3516d83Copy full SHA for 3516d83
lib/parse.js
@@ -221,9 +221,14 @@ var json_parse = function (options) {
221
// logicc.
222
// max 17 character before e else we return big number
223
if (string.replace('.','').split(/[eE]/)[0].length > 15) {
224
- return _options.useNativeBigInt
225
- ? BigInt(string)
226
- : new BigNumber(string);
+ if (_options.useNativeBigInt) {
+ try {
+ return BigInt(string);
227
+ } catch (e) {
228
+ return number;
229
+ }
230
231
+ return new BigNumber(string);
232
}
233
return number;
234
0 commit comments