@polkadot/util
Advanced tools
Comparing version 9.2.2-8 to 9.2.2-9
@@ -14,4 +14,4 @@ "use strict"; | ||
type: 'cjs', | ||
version: '9.2.2-8' | ||
version: '9.2.2-9' | ||
}; | ||
exports.packageInfo = packageInfo; |
@@ -29,3 +29,3 @@ "use strict"; | ||
function u8aToString(value) { | ||
return !(value !== null && value !== void 0 && value.length) ? '' : decoder.decode(value); | ||
return value ? decoder.decode(value) : ''; | ||
} |
@@ -37,4 +37,3 @@ "use strict"; | ||
function u8aToU8a(value) { | ||
return (0, _u8a.isU8a)(value) // under Node, Buffer implements Uint8Array, check it first | ||
? (0, _buffer.isBuffer)(value) ? new Uint8Array(value) : value : (0, _hex.isHex)(value) ? (0, _toU8a.hexToU8a)(value) : Array.isArray(value) ? new Uint8Array(value) : (0, _toU8a2.stringToU8a)(value); | ||
return (0, _u8a.isU8a)(value) ? value : (0, _hex.isHex)(value) ? (0, _toU8a.hexToU8a)(value) : (0, _buffer.isBuffer)(value) || Array.isArray(value) ? new Uint8Array(value) : (0, _toU8a2.stringToU8a)(value); | ||
} |
@@ -23,3 +23,3 @@ { | ||
"type": "module", | ||
"version": "9.2.2-8", | ||
"version": "9.2.2-9", | ||
"main": "./cjs/index.js", | ||
@@ -693,6 +693,6 @@ "module": "./index.js", | ||
"@babel/runtime": "^7.18.0", | ||
"@polkadot/x-bigint": "9.2.2-8", | ||
"@polkadot/x-global": "9.2.2-8", | ||
"@polkadot/x-textdecoder": "9.2.2-8", | ||
"@polkadot/x-textencoder": "9.2.2-8", | ||
"@polkadot/x-bigint": "9.2.2-9", | ||
"@polkadot/x-global": "9.2.2-9", | ||
"@polkadot/x-textdecoder": "9.2.2-9", | ||
"@polkadot/x-textencoder": "9.2.2-9", | ||
"@types/bn.js": "^5.1.0", | ||
@@ -699,0 +699,0 @@ "bn.js": "^5.2.0", |
@@ -8,3 +8,3 @@ // Copyright 2017-2022 @polkadot/util authors & contributors | ||
type: 'esm', | ||
version: '9.2.2-8' | ||
version: '9.2.2-9' | ||
}; |
@@ -21,3 +21,3 @@ // Copyright 2017-2022 @polkadot/util authors & contributors | ||
export function u8aToString(value) { | ||
return !(value !== null && value !== void 0 && value.length) ? '' : decoder.decode(value); | ||
return value ? decoder.decode(value) : ''; | ||
} |
@@ -25,4 +25,3 @@ // Copyright 2017-2022 @polkadot/util authors & contributors | ||
export function u8aToU8a(value) { | ||
return isU8a(value) // under Node, Buffer implements Uint8Array, check it first | ||
? isBuffer(value) ? new Uint8Array(value) : value : isHex(value) ? hexToU8a(value) : Array.isArray(value) ? new Uint8Array(value) : stringToU8a(value); | ||
return isU8a(value) ? value : isHex(value) ? hexToU8a(value) : isBuffer(value) || Array.isArray(value) ? new Uint8Array(value) : stringToU8a(value); | ||
} |
Sorry, the diff of this file is too big to display
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
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
493079
14210
+ Added@polkadot/x-bigint@9.2.2-9(transitive)
+ Added@polkadot/x-global@9.2.2-9(transitive)
+ Added@polkadot/x-textdecoder@9.2.2-9(transitive)
+ Added@polkadot/x-textencoder@9.2.2-9(transitive)
+ Added@types/node@22.10.2(transitive)
- Removed@polkadot/x-bigint@9.2.2-8(transitive)
- Removed@polkadot/x-global@9.2.2-8(transitive)
- Removed@polkadot/x-textdecoder@9.2.2-8(transitive)
- Removed@polkadot/x-textencoder@9.2.2-8(transitive)
- Removed@types/node@22.10.5(transitive)
Updated@polkadot/x-bigint@9.2.2-9
Updated@polkadot/x-global@9.2.2-9