@polkadot/types-create 8.5.2-1 → 8.5.2-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/cjs/create/class.js +4 -1
- package/cjs/packageInfo.js +1 -1
- package/create/class.js +5 -2
- package/package.json +2 -2
- package/packageInfo.js +1 -1
package/cjs/create/class.js
CHANGED
|
@@ -116,7 +116,10 @@ const infoMapping = {
|
|
|
116
116
|
},
|
|
117
117
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
118
118
|
[_types.TypeDefInfo.Null]: (registry, _) => _typesCodec.Null,
|
|
119
|
-
[_types.TypeDefInfo.Option]: (registry, value) =>
|
|
119
|
+
[_types.TypeDefInfo.Option]: (registry, value) => {
|
|
120
|
+
(0, _util.assert)(value.sub && !Array.isArray(value.sub), 'Expected type information for Option');
|
|
121
|
+
return value.sub.type === 'bool' ? _typesCodec.OptionBool : createWithSub(_typesCodec.Option, value);
|
|
122
|
+
},
|
|
120
123
|
[_types.TypeDefInfo.Plain]: (registry, value) => registry.getOrUnknown(value.type),
|
|
121
124
|
[_types.TypeDefInfo.Range]: (registry, value) => createWithSub(_typesCodec.Range, value),
|
|
122
125
|
[_types.TypeDefInfo.RangeInclusive]: (registry, value) => createWithSub(_typesCodec.RangeInclusive, value),
|
package/cjs/packageInfo.js
CHANGED
package/create/class.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-create authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
|
|
3
|
+
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, OptionBool, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
|
|
4
4
|
import { assert, isNumber, stringify } from '@polkadot/util';
|
|
5
5
|
import { TypeDefInfo } from "../types/index.js";
|
|
6
6
|
import { getTypeDef } from "../util/getTypeDef.js";
|
|
@@ -97,7 +97,10 @@ const infoMapping = {
|
|
|
97
97
|
},
|
|
98
98
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
99
99
|
[TypeDefInfo.Null]: (registry, _) => Null,
|
|
100
|
-
[TypeDefInfo.Option]: (registry, value) =>
|
|
100
|
+
[TypeDefInfo.Option]: (registry, value) => {
|
|
101
|
+
assert(value.sub && !Array.isArray(value.sub), 'Expected type information for Option');
|
|
102
|
+
return value.sub.type === 'bool' ? OptionBool : createWithSub(Option, value);
|
|
103
|
+
},
|
|
101
104
|
[TypeDefInfo.Plain]: (registry, value) => registry.getOrUnknown(value.type),
|
|
102
105
|
[TypeDefInfo.Range]: (registry, value) => createWithSub(Range, value),
|
|
103
106
|
[TypeDefInfo.RangeInclusive]: (registry, value) => createWithSub(RangeInclusive, value),
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./cjs/detectPackage.js"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "8.5.2-
|
|
23
|
+
"version": "8.5.2-2",
|
|
24
24
|
"main": "./cjs/index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
26
|
"types": "./index.d.ts",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
},
|
|
122
122
|
"dependencies": {
|
|
123
123
|
"@babel/runtime": "^7.18.0",
|
|
124
|
-
"@polkadot/types-codec": "8.5.2-
|
|
124
|
+
"@polkadot/types-codec": "8.5.2-2",
|
|
125
125
|
"@polkadot/util": "^9.2.1"
|
|
126
126
|
}
|
|
127
127
|
}
|
package/packageInfo.js
CHANGED
|
@@ -5,5 +5,5 @@ export const packageInfo = {
|
|
|
5
5
|
name: '@polkadot/types-create',
|
|
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.5.2-
|
|
8
|
+
version: '8.5.2-2'
|
|
9
9
|
};
|