web3-utils
Advanced tools
Comparing version 4.2.2-dev.f943944.0 to 4.2.2
@@ -368,2 +368,9 @@ "use strict"; | ||
if (typeof value === 'number') { | ||
if (value > 1e+20) { | ||
// JavaScript converts numbers >= 10^21 to scientific notation when coerced to strings, | ||
// leading to potential parsing errors and incorrect representations. | ||
// For instance, String(10000000000000000000000) yields '1e+22'. | ||
// Using BigInt prevents this | ||
return BigInt(value); | ||
} | ||
return value; | ||
@@ -370,0 +377,0 @@ } |
@@ -353,2 +353,9 @@ /* | ||
if (typeof value === 'number') { | ||
if (value > 1e+20) { | ||
// JavaScript converts numbers >= 10^21 to scientific notation when coerced to strings, | ||
// leading to potential parsing errors and incorrect representations. | ||
// For instance, String(10000000000000000000000) yields '1e+22'. | ||
// Using BigInt prevents this | ||
return BigInt(value); | ||
} | ||
return value; | ||
@@ -355,0 +362,0 @@ } |
{ | ||
"name": "web3-utils", | ||
"sideEffects": false, | ||
"version": "4.2.2-dev.f943944.0+f943944", | ||
"version": "4.2.2", | ||
"description": "Collection of utility functions used in web3.js.", | ||
@@ -68,7 +68,7 @@ "main": "./lib/commonjs/index.js", | ||
"eventemitter3": "^5.0.1", | ||
"web3-errors": "1.1.5-dev.f943944.0+f943944", | ||
"web3-types": "1.5.1-dev.f943944.0+f943944", | ||
"web3-validator": "2.0.5-dev.f943944.0+f943944" | ||
"web3-errors": "^1.1.4", | ||
"web3-types": "^1.5.0", | ||
"web3-validator": "^2.0.5" | ||
}, | ||
"gitHead": "f943944b51d977f72d4db959be0e72adbcb68c12" | ||
"gitHead": "7379a3bb3c274eff76c64b2447e95c34282e04fd" | ||
} |
@@ -414,2 +414,9 @@ /* | ||
if (typeof value === 'number') { | ||
if (value > 1e+20) { | ||
// JavaScript converts numbers >= 10^21 to scientific notation when coerced to strings, | ||
// leading to potential parsing errors and incorrect representations. | ||
// For instance, String(10000000000000000000000) yields '1e+22'. | ||
// Using BigInt prevents this | ||
return BigInt(value); | ||
} | ||
return value; | ||
@@ -416,0 +423,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
522378
9912
1
0
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedweb3-errors@1.2.0(transitive)
+ Addedweb3-types@1.7.0(transitive)
+ Addedweb3-validator@2.0.6(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedzod@3.23.8(transitive)
Updatedweb3-errors@^1.1.4
Updatedweb3-types@^1.5.0
Updatedweb3-validator@^2.0.5