web3-utils
Advanced tools
Comparing version 4.2.3-dev.5341c3a.0 to 4.2.3-dev.578ebb6.0
@@ -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.5341c3a.0+5341c3a", | ||
"version": "4.2.3-dev.578ebb6.0+578ebb6", | ||
"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.5341c3a.0+5341c3a", | ||
"web3-types": "1.5.1-dev.5341c3a.0+5341c3a", | ||
"web3-validator": "2.0.6-dev.5341c3a.0+5341c3a" | ||
"web3-errors": "1.1.5-dev.578ebb6.0+578ebb6", | ||
"web3-types": "1.5.1-dev.578ebb6.0+578ebb6", | ||
"web3-validator": "2.0.6-dev.578ebb6.0+578ebb6" | ||
}, | ||
"gitHead": "5341c3ab30aee24f678fc155d3e41483e3f5e68f" | ||
"gitHead": "578ebb69f0c16a5fc742c214d11b79e3d777ea04" | ||
} |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
523532
9924