@polkadot/types-codec 9.13.1 → 9.13.2
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/abstract/Int.d.ts +1 -1
- package/abstract/Int.js +2 -0
- package/base/Int.d.ts +1 -1
- package/cjs/abstract/Int.js +2 -0
- package/cjs/packageInfo.js +1 -1
- package/package.json +1 -1
- package/packageInfo.js +1 -1
package/abstract/Int.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare abstract class AbstractInt extends BN implements INumber {
|
|
|
16
16
|
createdAtHash?: IU8a;
|
|
17
17
|
initialU8aLength?: number;
|
|
18
18
|
isStorageFallback?: boolean;
|
|
19
|
-
constructor(registry: Registry, value?: AnyNumber, bitLength?: UIntBitLength, isSigned?: boolean);
|
|
19
|
+
constructor(registry: Registry, value?: AnyNumber | null, bitLength?: UIntBitLength, isSigned?: boolean);
|
|
20
20
|
/**
|
|
21
21
|
* @description returns a hash of the contents
|
|
22
22
|
*/
|
package/abstract/Int.js
CHANGED
|
@@ -49,6 +49,8 @@ function decodeAbstractInt(value, isNegative) {
|
|
|
49
49
|
throw new Error('Unable to construct number from multi-key object');
|
|
50
50
|
}
|
|
51
51
|
return decodeAbstractInt(value[keys[0]], isNegative);
|
|
52
|
+
} else if (!value) {
|
|
53
|
+
return 0;
|
|
52
54
|
}
|
|
53
55
|
throw new Error(`Unable to create BN from unknown type ${typeof value}`);
|
|
54
56
|
}
|
package/base/Int.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ import { AbstractInt } from '../abstract/Int';
|
|
|
11
11
|
* @noInheritDoc
|
|
12
12
|
*/
|
|
13
13
|
export declare class Int extends AbstractInt {
|
|
14
|
-
constructor(registry: Registry, value?: AnyNumber, bitLength?: UIntBitLength);
|
|
14
|
+
constructor(registry: Registry, value?: AnyNumber | null, bitLength?: UIntBitLength);
|
|
15
15
|
static with(bitLength: UIntBitLength, typeName?: string): CodecClass<Int>;
|
|
16
16
|
}
|
package/cjs/abstract/Int.js
CHANGED
|
@@ -56,6 +56,8 @@ function decodeAbstractInt(value, isNegative) {
|
|
|
56
56
|
throw new Error('Unable to construct number from multi-key object');
|
|
57
57
|
}
|
|
58
58
|
return decodeAbstractInt(value[keys[0]], isNegative);
|
|
59
|
+
} else if (!value) {
|
|
60
|
+
return 0;
|
|
59
61
|
}
|
|
60
62
|
throw new Error(`Unable to create BN from unknown type ${typeof value}`);
|
|
61
63
|
}
|
package/cjs/packageInfo.js
CHANGED
package/package.json
CHANGED
package/packageInfo.js
CHANGED
|
@@ -7,5 +7,5 @@ export const packageInfo = {
|
|
|
7
7
|
name: '@polkadot/types-codec',
|
|
8
8
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
9
9
|
type: 'esm',
|
|
10
|
-
version: '9.13.
|
|
10
|
+
version: '9.13.2'
|
|
11
11
|
};
|