@polkadot/types-create 8.6.1 → 8.6.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.
@@ -117,8 +117,12 @@ const infoMapping = {
117
117
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
118
118
  [_types.TypeDefInfo.Null]: (registry, _) => _typesCodec.Null,
119
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);
120
+ (0, _util.assert)(value.sub && !Array.isArray(value.sub), 'Expected type information for Option'); // NOTE This is opt-in (unhandled), not by default
121
+ // if (value.sub.type === 'bool') {
122
+ // return OptionBool;
123
+ // }
124
+
125
+ return createWithSub(_typesCodec.Option, value);
122
126
  },
123
127
  [_types.TypeDefInfo.Plain]: (registry, value) => registry.getOrUnknown(value.type),
124
128
  [_types.TypeDefInfo.Range]: (registry, value) => createWithSub(_typesCodec.Range, value),
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/types-create',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '8.6.1'
14
+ version: '8.6.2'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
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, OptionBool, 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, 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";
@@ -98,8 +98,12 @@ const infoMapping = {
98
98
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
99
99
  [TypeDefInfo.Null]: (registry, _) => Null,
100
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);
101
+ assert(value.sub && !Array.isArray(value.sub), 'Expected type information for Option'); // NOTE This is opt-in (unhandled), not by default
102
+ // if (value.sub.type === 'bool') {
103
+ // return OptionBool;
104
+ // }
105
+
106
+ return createWithSub(Option, value);
103
107
  },
104
108
  [TypeDefInfo.Plain]: (registry, value) => registry.getOrUnknown(value.type),
105
109
  [TypeDefInfo.Range]: (registry, value) => createWithSub(Range, value),
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./cjs/detectPackage.js"
21
21
  ],
22
22
  "type": "module",
23
- "version": "8.6.1",
23
+ "version": "8.6.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.3",
124
- "@polkadot/types-codec": "8.6.1",
124
+ "@polkadot/types-codec": "8.6.2",
125
125
  "@polkadot/util": "^9.3.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.6.1'
8
+ version: '8.6.2'
9
9
  };