@polkadot/types-codec 8.2.2-0 → 8.2.2-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/extended/U8aFixed.js +1 -1
- package/cjs/packageInfo.js +1 -1
- package/extended/U8aFixed.js +2 -2
- package/package.json +2 -2
- package/packageInfo.js +1 -1
package/cjs/extended/U8aFixed.js
CHANGED
|
@@ -21,7 +21,7 @@ function decodeU8aFixed(value, bitLength) {
|
|
|
21
21
|
return [new Uint8Array(byteLength), 0];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
(0, _util.assert)(u8a.length >= byteLength, () => `Expected
|
|
24
|
+
(0, _util.assert)((0, _util.isU8a)(value) ? u8a.length >= byteLength : u8a.length === byteLength, () => `Expected input with ${byteLength} bytes (${bitLength} bits), found ${u8a.length} bytes`);
|
|
25
25
|
return [u8a.subarray(0, byteLength), byteLength];
|
|
26
26
|
}
|
|
27
27
|
/**
|
package/cjs/packageInfo.js
CHANGED
package/extended/U8aFixed.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { assert, u8aToU8a } from '@polkadot/util';
|
|
3
|
+
import { assert, isU8a, u8aToU8a } from '@polkadot/util';
|
|
4
4
|
import { Raw } from "../native/Raw.js";
|
|
5
5
|
/** @internal */
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ function decodeU8aFixed(value, bitLength) {
|
|
|
12
12
|
return [new Uint8Array(byteLength), 0];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
assert(u8a.length >= byteLength, () => `Expected
|
|
15
|
+
assert(isU8a(value) ? u8a.length >= byteLength : u8a.length === byteLength, () => `Expected input with ${byteLength} bytes (${bitLength} bits), found ${u8a.length} bytes`);
|
|
16
16
|
return [u8a.subarray(0, byteLength), byteLength];
|
|
17
17
|
}
|
|
18
18
|
/**
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./cjs/detectPackage.js"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "8.2.2-
|
|
23
|
+
"version": "8.2.2-11",
|
|
24
24
|
"main": "./cjs/index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
26
|
"types": "./index.d.ts",
|
|
@@ -410,6 +410,6 @@
|
|
|
410
410
|
},
|
|
411
411
|
"dependencies": {
|
|
412
412
|
"@babel/runtime": "^7.17.9",
|
|
413
|
-
"@polkadot/util": "^9.
|
|
413
|
+
"@polkadot/util": "^9.1.1"
|
|
414
414
|
}
|
|
415
415
|
}
|
package/packageInfo.js
CHANGED
|
@@ -5,5 +5,5 @@ export const packageInfo = {
|
|
|
5
5
|
name: '@polkadot/types-codec',
|
|
6
6
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
7
7
|
type: 'esm',
|
|
8
|
-
version: '8.2.2-
|
|
8
|
+
version: '8.2.2-11'
|
|
9
9
|
};
|