web3-utils
Advanced tools
Comparing version 4.2.3-dev.ce59737.0 to 4.2.3
@@ -323,2 +323,5 @@ "use strict"; | ||
} | ||
if ((0, uint8array_js_1.isUint8Array)(value)) { | ||
return returnType ? 'bytes' : (0, exports.bytesToHex)(value); | ||
} | ||
if (typeof value === 'object' && !!value) { | ||
@@ -325,0 +328,0 @@ return returnType ? 'string' : (0, exports.utf8ToHex)(JSON.stringify(value)); |
@@ -21,5 +21,6 @@ "use strict"; | ||
function isUint8Array(data) { | ||
var _a; | ||
var _a, _b; | ||
return (data instanceof Uint8Array || | ||
((_a = data === null || data === void 0 ? void 0 : data.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Uint8Array'); | ||
((_a = data === null || data === void 0 ? void 0 : data.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Uint8Array' || | ||
((_b = data === null || data === void 0 ? void 0 : data.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'Buffer'); | ||
} | ||
@@ -26,0 +27,0 @@ exports.isUint8Array = isUint8Array; |
@@ -309,2 +309,5 @@ /* | ||
} | ||
if (isUint8Array(value)) { | ||
return returnType ? 'bytes' : bytesToHex(value); | ||
} | ||
if (typeof value === 'object' && !!value) { | ||
@@ -311,0 +314,0 @@ return returnType ? 'string' : utf8ToHex(JSON.stringify(value)); |
@@ -18,5 +18,6 @@ /* | ||
export function isUint8Array(data) { | ||
var _a; | ||
var _a, _b; | ||
return (data instanceof Uint8Array || | ||
((_a = data === null || data === void 0 ? void 0 : data.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Uint8Array'); | ||
((_a = data === null || data === void 0 ? void 0 : data.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Uint8Array' || | ||
((_b = data === null || data === void 0 ? void 0 : data.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'Buffer'); | ||
} | ||
@@ -23,0 +24,0 @@ export function uint8ArrayConcat(...parts) { |
{ | ||
"name": "web3-utils", | ||
"sideEffects": false, | ||
"version": "4.2.3-dev.ce59737.0+ce59737", | ||
"version": "4.2.3", | ||
"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.ce59737.0+ce59737", | ||
"web3-types": "1.5.1-dev.ce59737.0+ce59737", | ||
"web3-validator": "2.0.6-dev.ce59737.0+ce59737" | ||
"web3-errors": "^1.1.4", | ||
"web3-types": "^1.6.0", | ||
"web3-validator": "^2.0.5" | ||
}, | ||
"gitHead": "ce5973719a598352831d871b4de167c363c4517f" | ||
"gitHead": "93eeccb96d7bcddfa49ed4c4848dbf55b825546c" | ||
} |
@@ -365,2 +365,6 @@ /* | ||
if(isUint8Array(value)) { | ||
return returnType ? 'bytes' : bytesToHex(value); | ||
} | ||
if (typeof value === 'object' && !!value) { | ||
@@ -367,0 +371,0 @@ return returnType ? 'string' : utf8ToHex(JSON.stringify(value)); |
@@ -21,3 +21,4 @@ /* | ||
data instanceof Uint8Array || | ||
(data as { constructor: { name: string } })?.constructor?.name === 'Uint8Array' | ||
(data as { constructor: { name: string } })?.constructor?.name === 'Uint8Array' || | ||
(data as { constructor: { name: string } })?.constructor?.name === 'Buffer' | ||
); | ||
@@ -24,0 +25,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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
523447
9924
0
16
36
1
251
+ 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.1.4(transitive)
+ Addedweb3-types@1.6.0(transitive)
+ Addedweb3-validator@2.0.5(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedzod@3.23.8(transitive)
Updatedweb3-errors@^1.1.4
Updatedweb3-types@^1.6.0
Updatedweb3-validator@^2.0.5