Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

@polkadot/util

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/util - npm Package Compare versions

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