@polkadot/types-create 7.14.4-9 → 7.15.2-1

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.
@@ -10,7 +10,7 @@ var _exportNames = {
10
10
  Object.defineProperty(exports, "TypeDefInfo", {
11
11
  enumerable: true,
12
12
  get: function () {
13
- return _index.TypeDefInfo;
13
+ return _types.TypeDefInfo;
14
14
  }
15
15
  });
16
16
  Object.defineProperty(exports, "packageInfo", {
@@ -20,34 +20,34 @@ Object.defineProperty(exports, "packageInfo", {
20
20
  }
21
21
  });
22
22
 
23
- var _packageInfo = require("./packageInfo.cjs");
23
+ var _packageInfo = require("./packageInfo");
24
24
 
25
- var _index = require("./types/index.cjs");
25
+ var _types = require("./types");
26
26
 
27
- var _index2 = require("./create/index.cjs");
27
+ var _create = require("./create");
28
28
 
29
- Object.keys(_index2).forEach(function (key) {
29
+ Object.keys(_create).forEach(function (key) {
30
30
  if (key === "default" || key === "__esModule") return;
31
31
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
- if (key in exports && exports[key] === _index2[key]) return;
32
+ if (key in exports && exports[key] === _create[key]) return;
33
33
  Object.defineProperty(exports, key, {
34
34
  enumerable: true,
35
35
  get: function () {
36
- return _index2[key];
36
+ return _create[key];
37
37
  }
38
38
  });
39
39
  });
40
40
 
41
- var _index3 = require("./util/index.cjs");
41
+ var _util = require("./util");
42
42
 
43
- Object.keys(_index3).forEach(function (key) {
43
+ Object.keys(_util).forEach(function (key) {
44
44
  if (key === "default" || key === "__esModule") return;
45
45
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
46
- if (key in exports && exports[key] === _index3[key]) return;
46
+ if (key in exports && exports[key] === _util[key]) return;
47
47
  Object.defineProperty(exports, key, {
48
48
  enumerable: true,
49
49
  get: function () {
50
- return _index3[key];
50
+ return _util[key];
51
51
  }
52
52
  });
53
53
  });
@@ -11,9 +11,9 @@ var _typesCodec = require("@polkadot/types-codec");
11
11
 
12
12
  var _util = require("@polkadot/util");
13
13
 
14
- var _index = require("../types/index.cjs");
14
+ var _types = require("../types");
15
15
 
16
- var _getTypeDef = require("../util/getTypeDef.cjs");
16
+ var _getTypeDef = require("../util/getTypeDef");
17
17
 
18
18
  // Copyright 2017-2022 @polkadot/types-create authors & contributors
19
19
  // SPDX-License-Identifier: Apache-2.0
@@ -75,11 +75,11 @@ function createWithSub(Clazz, value) {
75
75
  }
76
76
 
77
77
  const infoMapping = {
78
- [_index.TypeDefInfo.BTreeMap]: (registry, value) => createHashMap(_typesCodec.BTreeMap, value),
79
- [_index.TypeDefInfo.BTreeSet]: (registry, value) => createWithSub(_typesCodec.BTreeSet, value),
80
- [_index.TypeDefInfo.Compact]: (registry, value) => createWithSub(_typesCodec.Compact, value),
81
- [_index.TypeDefInfo.DoNotConstruct]: (registry, value) => _typesCodec.DoNotConstruct.with(value.displayName || value.type),
82
- [_index.TypeDefInfo.Enum]: (registry, value) => {
78
+ [_types.TypeDefInfo.BTreeMap]: (registry, value) => createHashMap(_typesCodec.BTreeMap, value),
79
+ [_types.TypeDefInfo.BTreeSet]: (registry, value) => createWithSub(_typesCodec.BTreeSet, value),
80
+ [_types.TypeDefInfo.Compact]: (registry, value) => createWithSub(_typesCodec.Compact, value),
81
+ [_types.TypeDefInfo.DoNotConstruct]: (registry, value) => _typesCodec.DoNotConstruct.with(value.displayName || value.type),
82
+ [_types.TypeDefInfo.Enum]: (registry, value) => {
83
83
  const subs = getSubDefArray(value);
84
84
  return _typesCodec.Enum.with(subs.every(_ref3 => {
85
85
  let {
@@ -95,10 +95,10 @@ const infoMapping = {
95
95
  return out;
96
96
  }, {}) : getTypeClassMap(value));
97
97
  },
98
- [_index.TypeDefInfo.HashMap]: (registry, value) => createHashMap(_typesCodec.HashMap, value),
99
- [_index.TypeDefInfo.Int]: (registry, value) => createInt(_typesCodec.Int, value),
98
+ [_types.TypeDefInfo.HashMap]: (registry, value) => createHashMap(_typesCodec.HashMap, value),
99
+ [_types.TypeDefInfo.Int]: (registry, value) => createInt(_typesCodec.Int, value),
100
100
  // We have circular deps between Linkage & Struct
101
- [_index.TypeDefInfo.Linkage]: (registry, value) => {
101
+ [_types.TypeDefInfo.Linkage]: (registry, value) => {
102
102
  const type = `Option<${getSubType(value)}>`; // eslint-disable-next-line sort-keys
103
103
 
104
104
  const Clazz = _typesCodec.Struct.with({
@@ -115,12 +115,12 @@ const infoMapping = {
115
115
  return Clazz;
116
116
  },
117
117
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
118
- [_index.TypeDefInfo.Null]: (registry, _) => _typesCodec.Null,
119
- [_index.TypeDefInfo.Option]: (registry, value) => createWithSub(_typesCodec.Option, value),
120
- [_index.TypeDefInfo.Plain]: (registry, value) => registry.getOrUnknown(value.type),
121
- [_index.TypeDefInfo.Range]: (registry, value) => createWithSub(_typesCodec.Range, value),
122
- [_index.TypeDefInfo.RangeInclusive]: (registry, value) => createWithSub(_typesCodec.RangeInclusive, value),
123
- [_index.TypeDefInfo.Result]: (registry, value) => {
118
+ [_types.TypeDefInfo.Null]: (registry, _) => _typesCodec.Null,
119
+ [_types.TypeDefInfo.Option]: (registry, value) => createWithSub(_typesCodec.Option, value),
120
+ [_types.TypeDefInfo.Plain]: (registry, value) => registry.getOrUnknown(value.type),
121
+ [_types.TypeDefInfo.Range]: (registry, value) => createWithSub(_typesCodec.Range, value),
122
+ [_types.TypeDefInfo.RangeInclusive]: (registry, value) => createWithSub(_typesCodec.RangeInclusive, value),
123
+ [_types.TypeDefInfo.Result]: (registry, value) => {
124
124
  const [Ok, Err] = getTypeClassArray(value); // eslint-disable-next-line @typescript-eslint/no-use-before-define
125
125
 
126
126
  return _typesCodec.Result.with({
@@ -128,7 +128,7 @@ const infoMapping = {
128
128
  Ok
129
129
  });
130
130
  },
131
- [_index.TypeDefInfo.Set]: (registry, value) => _typesCodec.CodecSet.with(getSubDefArray(value).reduce((result, _ref5) => {
131
+ [_types.TypeDefInfo.Set]: (registry, value) => _typesCodec.CodecSet.with(getSubDefArray(value).reduce((result, _ref5) => {
132
132
  let {
133
133
  index,
134
134
  name
@@ -136,18 +136,18 @@ const infoMapping = {
136
136
  result[name] = index;
137
137
  return result;
138
138
  }, {}), value.length),
139
- [_index.TypeDefInfo.Si]: (registry, value) => getTypeClass(registry, registry.lookup.getTypeDef(value.type)),
140
- [_index.TypeDefInfo.Struct]: (registry, value) => _typesCodec.Struct.with(getTypeClassMap(value), value.alias),
141
- [_index.TypeDefInfo.Tuple]: (registry, value) => _typesCodec.Tuple.with(getTypeClassArray(value)),
142
- [_index.TypeDefInfo.UInt]: (registry, value) => createInt(_typesCodec.UInt, value),
143
- [_index.TypeDefInfo.Vec]: (registry, _ref6) => {
139
+ [_types.TypeDefInfo.Si]: (registry, value) => getTypeClass(registry, registry.lookup.getTypeDef(value.type)),
140
+ [_types.TypeDefInfo.Struct]: (registry, value) => _typesCodec.Struct.with(getTypeClassMap(value), value.alias),
141
+ [_types.TypeDefInfo.Tuple]: (registry, value) => _typesCodec.Tuple.with(getTypeClassArray(value)),
142
+ [_types.TypeDefInfo.UInt]: (registry, value) => createInt(_typesCodec.UInt, value),
143
+ [_types.TypeDefInfo.Vec]: (registry, _ref6) => {
144
144
  let {
145
145
  sub
146
146
  } = _ref6;
147
147
  (0, _util.assert)(sub && !Array.isArray(sub), 'Expected type information for vector');
148
148
  return sub.type === 'u8' ? _typesCodec.Bytes : _typesCodec.Vec.with(getTypeDefType(sub));
149
149
  },
150
- [_index.TypeDefInfo.VecFixed]: (registry, _ref7) => {
150
+ [_types.TypeDefInfo.VecFixed]: (registry, _ref7) => {
151
151
  let {
152
152
  displayName,
153
153
  length,
@@ -156,8 +156,8 @@ const infoMapping = {
156
156
  (0, _util.assert)(sub && (0, _util.isNumber)(length) && !Array.isArray(sub), 'Expected length & type information for fixed vector');
157
157
  return sub.type === 'u8' ? _typesCodec.U8aFixed.with(length * 8, displayName) : _typesCodec.VecFixed.with(getTypeDefType(sub), length);
158
158
  },
159
- [_index.TypeDefInfo.WrapperKeepOpaque]: (registry, value) => createWithSub(_typesCodec.WrapperKeepOpaque, value),
160
- [_index.TypeDefInfo.WrapperOpaque]: (registry, value) => createWithSub(_typesCodec.WrapperOpaque, value)
159
+ [_types.TypeDefInfo.WrapperKeepOpaque]: (registry, value) => createWithSub(_typesCodec.WrapperKeepOpaque, value),
160
+ [_types.TypeDefInfo.WrapperOpaque]: (registry, value) => createWithSub(_typesCodec.WrapperOpaque, value)
161
161
  };
162
162
 
163
163
  function constructTypeClass(registry, typeDef) {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _class = require("./class.cjs");
7
+ var _class = require("./class");
8
8
 
9
9
  Object.keys(_class).forEach(function (key) {
10
10
  if (key === "default" || key === "__esModule") return;
@@ -17,7 +17,7 @@ Object.keys(_class).forEach(function (key) {
17
17
  });
18
18
  });
19
19
 
20
- var _type = require("./type.cjs");
20
+ var _type = require("./type");
21
21
 
22
22
  Object.keys(_type).forEach(function (key) {
23
23
  if (key === "default" || key === "__esModule") return;
@@ -9,7 +9,7 @@ var _typesCodec = require("@polkadot/types-codec");
9
9
 
10
10
  var _util = require("@polkadot/util");
11
11
 
12
- var _class = require("./class.cjs");
12
+ var _class = require("./class");
13
13
 
14
14
  // Copyright 2017-2022 @polkadot/types-create authors & contributors
15
15
  // SPDX-License-Identifier: Apache-2.0
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _packageInfo = require("@polkadot/types-codec/packageInfo.cjs");
8
+ var _packageInfo = require("@polkadot/types-codec/cjs/packageInfo");
9
9
 
10
10
  // Copyright 2017-2022 @polkadot/types-create authors & contributors
11
11
  // SPDX-License-Identifier: Apache-2.0
@@ -4,9 +4,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
 
5
5
  var _util = require("@polkadot/util");
6
6
 
7
- var _detectOther = _interopRequireDefault(require("./detectOther.cjs"));
7
+ var _detectOther = _interopRequireDefault(require("./detectOther"));
8
8
 
9
- var _packageInfo = require("./packageInfo.cjs");
9
+ var _packageInfo = require("./packageInfo");
10
10
 
11
11
  // Copyright 2017-2022 @polkadot/types-create authors & contributors
12
12
  // SPDX-License-Identifier: Apache-2.0
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- require("./detectPackage.cjs");
7
+ require("./detectPackage");
8
8
 
9
- var _bundle = require("./bundle.cjs");
9
+ var _bundle = require("./bundle");
10
10
 
11
11
  Object.keys(_bundle).forEach(function (key) {
12
12
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -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: '7.14.4-9'
14
+ version: '7.15.2-1'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- require("./augmentRegistry.cjs");
7
+ require("./augmentRegistry");
8
8
 
9
- var _lookup = require("./lookup.cjs");
9
+ var _lookup = require("./lookup");
10
10
 
11
11
  Object.keys(_lookup).forEach(function (key) {
12
12
  if (key === "default" || key === "__esModule") return;
@@ -19,7 +19,7 @@ Object.keys(_lookup).forEach(function (key) {
19
19
  });
20
20
  });
21
21
 
22
- var _types = require("./types.cjs");
22
+ var _types = require("./types");
23
23
 
24
24
  Object.keys(_types).forEach(function (key) {
25
25
  if (key === "default" || key === "__esModule") return;
File without changes
File without changes
@@ -9,7 +9,7 @@ exports.withTypeString = withTypeString;
9
9
 
10
10
  var _util = require("@polkadot/util");
11
11
 
12
- var _index = require("../types/index.cjs");
12
+ var _types = require("../types");
13
13
 
14
14
  // Copyright 2017-2022 @polkadot/types-create authors & contributors
15
15
  // SPDX-License-Identifier: Apache-2.0
@@ -29,18 +29,18 @@ function encodeWithParams(registry, typeDef, outer) {
29
29
  } = typeDef;
30
30
 
31
31
  switch (info) {
32
- case _index.TypeDefInfo.BTreeMap:
33
- case _index.TypeDefInfo.BTreeSet:
34
- case _index.TypeDefInfo.Compact:
35
- case _index.TypeDefInfo.HashMap:
36
- case _index.TypeDefInfo.Linkage:
37
- case _index.TypeDefInfo.Option:
38
- case _index.TypeDefInfo.Range:
39
- case _index.TypeDefInfo.RangeInclusive:
40
- case _index.TypeDefInfo.Result:
41
- case _index.TypeDefInfo.Vec:
42
- case _index.TypeDefInfo.WrapperKeepOpaque:
43
- case _index.TypeDefInfo.WrapperOpaque:
32
+ case _types.TypeDefInfo.BTreeMap:
33
+ case _types.TypeDefInfo.BTreeSet:
34
+ case _types.TypeDefInfo.Compact:
35
+ case _types.TypeDefInfo.HashMap:
36
+ case _types.TypeDefInfo.Linkage:
37
+ case _types.TypeDefInfo.Option:
38
+ case _types.TypeDefInfo.Range:
39
+ case _types.TypeDefInfo.RangeInclusive:
40
+ case _types.TypeDefInfo.Result:
41
+ case _types.TypeDefInfo.Vec:
42
+ case _types.TypeDefInfo.WrapperKeepOpaque:
43
+ case _types.TypeDefInfo.WrapperOpaque:
44
44
  return paramsNotation(outer, sub, p => encodeTypeDef(registry, p));
45
45
  }
46
46
 
@@ -70,10 +70,10 @@ function encodeSubTypes(registry, sub, asEnum, extra) {
70
70
 
71
71
 
72
72
  const encoders = {
73
- [_index.TypeDefInfo.BTreeMap]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'BTreeMap'),
74
- [_index.TypeDefInfo.BTreeSet]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'BTreeSet'),
75
- [_index.TypeDefInfo.Compact]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Compact'),
76
- [_index.TypeDefInfo.DoNotConstruct]: (registry, _ref2) => {
73
+ [_types.TypeDefInfo.BTreeMap]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'BTreeMap'),
74
+ [_types.TypeDefInfo.BTreeSet]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'BTreeSet'),
75
+ [_types.TypeDefInfo.Compact]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Compact'),
76
+ [_types.TypeDefInfo.DoNotConstruct]: (registry, _ref2) => {
77
77
  let {
78
78
  displayName,
79
79
  lookupIndex,
@@ -81,7 +81,7 @@ const encoders = {
81
81
  } = _ref2;
82
82
  return `DoNotConstruct<${lookupName || displayName || ((0, _util.isUndefined)(lookupIndex) ? 'Unknown' : registry.createLookupType(lookupIndex))}>`;
83
83
  },
84
- [_index.TypeDefInfo.Enum]: (registry, _ref3) => {
84
+ [_types.TypeDefInfo.Enum]: (registry, _ref3) => {
85
85
  let {
86
86
  sub
87
87
  } = _ref3;
@@ -102,30 +102,30 @@ const encoders = {
102
102
  })
103
103
  }) : encodeSubTypes(registry, sub, true);
104
104
  },
105
- [_index.TypeDefInfo.HashMap]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'HashMap'),
106
- [_index.TypeDefInfo.Int]: (registry, _ref6) => {
105
+ [_types.TypeDefInfo.HashMap]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'HashMap'),
106
+ [_types.TypeDefInfo.Int]: (registry, _ref6) => {
107
107
  let {
108
108
  length = 32
109
109
  } = _ref6;
110
110
  return `Int<${length}>`;
111
111
  },
112
- [_index.TypeDefInfo.Linkage]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Linkage'),
112
+ [_types.TypeDefInfo.Linkage]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Linkage'),
113
113
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
114
- [_index.TypeDefInfo.Null]: (registry, typeDef) => 'Null',
115
- [_index.TypeDefInfo.Option]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Option'),
114
+ [_types.TypeDefInfo.Null]: (registry, typeDef) => 'Null',
115
+ [_types.TypeDefInfo.Option]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Option'),
116
116
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
117
- [_index.TypeDefInfo.Plain]: (registry, _ref7) => {
117
+ [_types.TypeDefInfo.Plain]: (registry, _ref7) => {
118
118
  let {
119
119
  displayName,
120
120
  type
121
121
  } = _ref7;
122
122
  return displayName || type;
123
123
  },
124
- [_index.TypeDefInfo.Range]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Range'),
125
- [_index.TypeDefInfo.RangeInclusive]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'RangeInclusive'),
126
- [_index.TypeDefInfo.Result]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Result'),
124
+ [_types.TypeDefInfo.Range]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Range'),
125
+ [_types.TypeDefInfo.RangeInclusive]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'RangeInclusive'),
126
+ [_types.TypeDefInfo.Result]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Result'),
127
127
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
128
- [_index.TypeDefInfo.Set]: (registry, _ref8) => {
128
+ [_types.TypeDefInfo.Set]: (registry, _ref8) => {
129
129
  let {
130
130
  length = 8,
131
131
  sub
@@ -146,14 +146,14 @@ const encoders = {
146
146
  });
147
147
  },
148
148
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
149
- [_index.TypeDefInfo.Si]: (registry, _ref10) => {
149
+ [_types.TypeDefInfo.Si]: (registry, _ref10) => {
150
150
  let {
151
151
  lookupName,
152
152
  type
153
153
  } = _ref10;
154
154
  return lookupName || type;
155
155
  },
156
- [_index.TypeDefInfo.Struct]: (registry, _ref11) => {
156
+ [_types.TypeDefInfo.Struct]: (registry, _ref11) => {
157
157
  let {
158
158
  alias,
159
159
  sub
@@ -168,21 +168,21 @@ const encoders = {
168
168
  }, {})
169
169
  } : {});
170
170
  },
171
- [_index.TypeDefInfo.Tuple]: (registry, _ref13) => {
171
+ [_types.TypeDefInfo.Tuple]: (registry, _ref13) => {
172
172
  let {
173
173
  sub
174
174
  } = _ref13;
175
175
  (0, _util.assert)(sub && Array.isArray(sub), 'Unable to encode Tuple type');
176
176
  return `(${sub.map(type => encodeTypeDef(registry, type)).join(',')})`;
177
177
  },
178
- [_index.TypeDefInfo.UInt]: (registry, _ref14) => {
178
+ [_types.TypeDefInfo.UInt]: (registry, _ref14) => {
179
179
  let {
180
180
  length = 32
181
181
  } = _ref14;
182
182
  return `UInt<${length}>`;
183
183
  },
184
- [_index.TypeDefInfo.Vec]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Vec'),
185
- [_index.TypeDefInfo.VecFixed]: (registry, _ref15) => {
184
+ [_types.TypeDefInfo.Vec]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'Vec'),
185
+ [_types.TypeDefInfo.VecFixed]: (registry, _ref15) => {
186
186
  let {
187
187
  length,
188
188
  sub
@@ -190,8 +190,8 @@ const encoders = {
190
190
  (0, _util.assert)((0, _util.isNumber)(length) && !(0, _util.isUndefined)(sub) && !Array.isArray(sub), 'Unable to encode VecFixed type');
191
191
  return `[${sub.type};${length}]`;
192
192
  },
193
- [_index.TypeDefInfo.WrapperKeepOpaque]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'WrapperKeepOpaque'),
194
- [_index.TypeDefInfo.WrapperOpaque]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'WrapperOpaque')
193
+ [_types.TypeDefInfo.WrapperKeepOpaque]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'WrapperKeepOpaque'),
194
+ [_types.TypeDefInfo.WrapperOpaque]: (registry, typeDef) => encodeWithParams(registry, typeDef, 'WrapperOpaque')
195
195
  };
196
196
 
197
197
  function encodeType(registry, typeDef) {
@@ -9,9 +9,9 @@ var _typesCodec = require("@polkadot/types-codec");
9
9
 
10
10
  var _util = require("@polkadot/util");
11
11
 
12
- var _index = require("../types/index.cjs");
12
+ var _types = require("../types");
13
13
 
14
- var _typeSplit = require("./typeSplit.cjs");
14
+ var _typeSplit = require("./typeSplit");
15
15
 
16
16
  // Copyright 2017-2022 @polkadot/types-create authors & contributors
17
17
  // SPDX-License-Identifier: Apache-2.0
@@ -38,13 +38,13 @@ function isRustEnum(details) {
38
38
 
39
39
 
40
40
  function _decodeEnum(value, details, count, fallbackType) {
41
- value.info = _index.TypeDefInfo.Enum;
41
+ value.info = _types.TypeDefInfo.Enum;
42
42
  value.fallbackType = fallbackType; // not as pretty, but remain compatible with oo7 for both struct and Array types
43
43
 
44
44
  if (Array.isArray(details)) {
45
45
  value.sub = details.map((name, index) => ({
46
46
  index,
47
- info: _index.TypeDefInfo.Plain,
47
+ info: _types.TypeDefInfo.Plain,
48
48
  name,
49
49
  type: 'Null'
50
50
  }));
@@ -62,7 +62,7 @@ function _decodeEnum(value, details, count, fallbackType) {
62
62
  let [name, index] = _ref2;
63
63
  return {
64
64
  index,
65
- info: _index.TypeDefInfo.Plain,
65
+ info: _types.TypeDefInfo.Plain,
66
66
  name,
67
67
  type: 'Null'
68
68
  };
@@ -75,7 +75,7 @@ function _decodeEnum(value, details, count, fallbackType) {
75
75
 
76
76
 
77
77
  function _decodeSet(value, details, fallbackType) {
78
- value.info = _index.TypeDefInfo.Set;
78
+ value.info = _types.TypeDefInfo.Set;
79
79
  value.fallbackType = fallbackType;
80
80
  value.length = details._bitLength;
81
81
  value.sub = Object.entries(details).filter(_ref3 => {
@@ -85,7 +85,7 @@ function _decodeSet(value, details, fallbackType) {
85
85
  let [name, index] = _ref4;
86
86
  return {
87
87
  index,
88
- info: _index.TypeDefInfo.Plain,
88
+ info: _types.TypeDefInfo.Plain,
89
89
  name,
90
90
  type: 'Null'
91
91
  };
@@ -180,9 +180,9 @@ function hasWrapper(type, _ref5) {
180
180
  return type.substr(0, start.length) === start && type.substr(-1 * end.length) === end;
181
181
  }
182
182
 
183
- const nestedExtraction = [['[', ']', _index.TypeDefInfo.VecFixed, _decodeFixedVec], ['{', '}', _index.TypeDefInfo.Struct, _decodeStruct], ['(', ')', _index.TypeDefInfo.Tuple, _decodeTuple], // the inner for these are the same as tuple, multiple values
184
- ['BTreeMap<', '>', _index.TypeDefInfo.BTreeMap, _decodeTuple], ['HashMap<', '>', _index.TypeDefInfo.HashMap, _decodeTuple], ['Int<', '>', _index.TypeDefInfo.Int, _decodeInt], ['Result<', '>', _index.TypeDefInfo.Result, _decodeTuple], ['UInt<', '>', _index.TypeDefInfo.UInt, _decodeUInt], ['DoNotConstruct<', '>', _index.TypeDefInfo.DoNotConstruct, _decodeDoNotConstruct]];
185
- const wrappedExtraction = [['BTreeSet<', '>', _index.TypeDefInfo.BTreeSet], ['Compact<', '>', _index.TypeDefInfo.Compact], ['Linkage<', '>', _index.TypeDefInfo.Linkage], ['Option<', '>', _index.TypeDefInfo.Option], ['Range<', '>', _index.TypeDefInfo.Range], ['RangeInclusive<', '>', _index.TypeDefInfo.RangeInclusive], ['Vec<', '>', _index.TypeDefInfo.Vec], ['WrapperKeepOpaque<', '>', _index.TypeDefInfo.WrapperKeepOpaque], ['WrapperOpaque<', '>', _index.TypeDefInfo.WrapperOpaque]];
183
+ const nestedExtraction = [['[', ']', _types.TypeDefInfo.VecFixed, _decodeFixedVec], ['{', '}', _types.TypeDefInfo.Struct, _decodeStruct], ['(', ')', _types.TypeDefInfo.Tuple, _decodeTuple], // the inner for these are the same as tuple, multiple values
184
+ ['BTreeMap<', '>', _types.TypeDefInfo.BTreeMap, _decodeTuple], ['HashMap<', '>', _types.TypeDefInfo.HashMap, _decodeTuple], ['Int<', '>', _types.TypeDefInfo.Int, _decodeInt], ['Result<', '>', _types.TypeDefInfo.Result, _decodeTuple], ['UInt<', '>', _types.TypeDefInfo.UInt, _decodeUInt], ['DoNotConstruct<', '>', _types.TypeDefInfo.DoNotConstruct, _decodeDoNotConstruct]];
185
+ const wrappedExtraction = [['BTreeSet<', '>', _types.TypeDefInfo.BTreeSet], ['Compact<', '>', _types.TypeDefInfo.Compact], ['Linkage<', '>', _types.TypeDefInfo.Linkage], ['Option<', '>', _types.TypeDefInfo.Option], ['Range<', '>', _types.TypeDefInfo.Range], ['RangeInclusive<', '>', _types.TypeDefInfo.RangeInclusive], ['Vec<', '>', _types.TypeDefInfo.Vec], ['WrapperKeepOpaque<', '>', _types.TypeDefInfo.WrapperKeepOpaque], ['WrapperOpaque<', '>', _types.TypeDefInfo.WrapperOpaque]];
186
186
 
187
187
  function extractSubType(type, _ref6) {
188
188
  let [start, end] = _ref6;
@@ -200,7 +200,7 @@ function getTypeDef(_type) {
200
200
  const type = (0, _typesCodec.sanitize)(_type);
201
201
  const value = {
202
202
  displayName,
203
- info: _index.TypeDefInfo.Plain,
203
+ info: _types.TypeDefInfo.Plain,
204
204
  name,
205
205
  type
206
206
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _encodeTypes = require("./encodeTypes.cjs");
7
+ var _encodeTypes = require("./encodeTypes");
8
8
 
9
9
  Object.keys(_encodeTypes).forEach(function (key) {
10
10
  if (key === "default" || key === "__esModule") return;
@@ -17,7 +17,7 @@ Object.keys(_encodeTypes).forEach(function (key) {
17
17
  });
18
18
  });
19
19
 
20
- var _getTypeDef = require("./getTypeDef.cjs");
20
+ var _getTypeDef = require("./getTypeDef");
21
21
 
22
22
  Object.keys(_getTypeDef).forEach(function (key) {
23
23
  if (key === "default" || key === "__esModule") return;
@@ -30,7 +30,7 @@ Object.keys(_getTypeDef).forEach(function (key) {
30
30
  });
31
31
  });
32
32
 
33
- var _typeSplit = require("./typeSplit.cjs");
33
+ var _typeSplit = require("./typeSplit");
34
34
 
35
35
  Object.keys(_typeSplit).forEach(function (key) {
36
36
  if (key === "default" || key === "__esModule") return;
@@ -43,7 +43,7 @@ Object.keys(_typeSplit).forEach(function (key) {
43
43
  });
44
44
  });
45
45
 
46
- var _xcm = require("./xcm.cjs");
46
+ var _xcm = require("./xcm");
47
47
 
48
48
  Object.keys(_xcm).forEach(function (key) {
49
49
  if (key === "default" || key === "__esModule") return;
File without changes
File without changes
package/package.json CHANGED
@@ -17,106 +17,111 @@
17
17
  },
18
18
  "sideEffects": [
19
19
  "./detectPackage.js",
20
- "./detectPackage.cjs"
20
+ "./cjs/detectPackage.js"
21
21
  ],
22
22
  "type": "module",
23
- "version": "7.14.4-9",
24
- "main": "index.cjs",
25
- "module": "index.js",
26
- "types": "index.d.ts",
23
+ "version": "7.15.2-1",
24
+ "main": "./cjs/index.js",
25
+ "module": "./index.js",
26
+ "types": "./index.d.ts",
27
27
  "exports": {
28
+ "./cjs/package.json": "./cjs/package.json",
29
+ "./cjs/*": "./cjs/*.js",
28
30
  ".": {
29
31
  "types": "./index.d.ts",
30
- "require": "./index.cjs",
32
+ "require": "./cjs/index.js",
31
33
  "default": "./index.js"
32
34
  },
33
35
  "./bundle": {
34
36
  "types": "./bundle.d.ts",
35
- "require": "./bundle.cjs",
37
+ "require": "./cjs/bundle.js",
36
38
  "default": "./bundle.js"
37
39
  },
38
40
  "./create": {
39
41
  "types": "./create/index.d.ts",
40
- "require": "./create/index.cjs",
42
+ "require": "./cjs/create/index.js",
41
43
  "default": "./create/index.js"
42
44
  },
43
45
  "./create/class": {
44
46
  "types": "./create/class.d.ts",
45
- "require": "./create/class.cjs",
47
+ "require": "./cjs/create/class.js",
46
48
  "default": "./create/class.js"
47
49
  },
48
50
  "./create/type": {
49
51
  "types": "./create/type.d.ts",
50
- "require": "./create/type.cjs",
52
+ "require": "./cjs/create/type.js",
51
53
  "default": "./create/type.js"
52
54
  },
53
55
  "./detectOther": {
54
56
  "types": "./detectOther.d.ts",
55
- "require": "./detectOther.cjs",
57
+ "require": "./cjs/detectOther.js",
56
58
  "default": "./detectOther.js"
57
59
  },
58
60
  "./detectPackage": {
59
61
  "types": "./detectPackage.d.ts",
60
- "require": "./detectPackage.cjs",
62
+ "require": "./cjs/detectPackage.js",
61
63
  "default": "./detectPackage.js"
62
64
  },
63
65
  "./package.json": "./package.json",
64
- "./packageInfo.cjs": "./packageInfo.cjs",
65
- "./packageInfo.js": "./packageInfo.js",
66
+ "./packageInfo.js": {
67
+ "types": "./packageInfo.d.ts",
68
+ "require": "./cjs/packageInfo.js",
69
+ "default": "./packageInfo.js"
70
+ },
66
71
  "./packageInfo": {
67
72
  "types": "./packageInfo.d.ts",
68
- "require": "./packageInfo.cjs",
73
+ "require": "./cjs/packageInfo.js",
69
74
  "default": "./packageInfo.js"
70
75
  },
71
76
  "./types": {
72
77
  "types": "./types/index.d.ts",
73
- "require": "./types/index.cjs",
78
+ "require": "./cjs/types/index.js",
74
79
  "default": "./types/index.js"
75
80
  },
76
81
  "./types/augmentRegistry": {
77
82
  "types": "./types/augmentRegistry.d.ts",
78
- "require": "./types/augmentRegistry.cjs",
83
+ "require": "./cjs/types/augmentRegistry.js",
79
84
  "default": "./types/augmentRegistry.js"
80
85
  },
81
86
  "./types/lookup": {
82
87
  "types": "./types/lookup.d.ts",
83
- "require": "./types/lookup.cjs",
88
+ "require": "./cjs/types/lookup.js",
84
89
  "default": "./types/lookup.js"
85
90
  },
86
91
  "./types/types": {
87
92
  "types": "./types/types.d.ts",
88
- "require": "./types/types.cjs",
93
+ "require": "./cjs/types/types.js",
89
94
  "default": "./types/types.js"
90
95
  },
91
96
  "./util": {
92
97
  "types": "./util/index.d.ts",
93
- "require": "./util/index.cjs",
98
+ "require": "./cjs/util/index.js",
94
99
  "default": "./util/index.js"
95
100
  },
96
101
  "./util/encodeTypes": {
97
102
  "types": "./util/encodeTypes.d.ts",
98
- "require": "./util/encodeTypes.cjs",
103
+ "require": "./cjs/util/encodeTypes.js",
99
104
  "default": "./util/encodeTypes.js"
100
105
  },
101
106
  "./util/getTypeDef": {
102
107
  "types": "./util/getTypeDef.d.ts",
103
- "require": "./util/getTypeDef.cjs",
108
+ "require": "./cjs/util/getTypeDef.js",
104
109
  "default": "./util/getTypeDef.js"
105
110
  },
106
111
  "./util/typeSplit": {
107
112
  "types": "./util/typeSplit.d.ts",
108
- "require": "./util/typeSplit.cjs",
113
+ "require": "./cjs/util/typeSplit.js",
109
114
  "default": "./util/typeSplit.js"
110
115
  },
111
116
  "./util/xcm": {
112
117
  "types": "./util/xcm.d.ts",
113
- "require": "./util/xcm.cjs",
118
+ "require": "./cjs/util/xcm.js",
114
119
  "default": "./util/xcm.js"
115
120
  }
116
121
  },
117
122
  "dependencies": {
118
123
  "@babel/runtime": "^7.17.8",
119
- "@polkadot/types-codec": "7.14.4-9",
120
- "@polkadot/util": "^8.7.1"
124
+ "@polkadot/types-codec": "7.15.2-1",
125
+ "@polkadot/util": "^8.7.2-1"
121
126
  }
122
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: '7.14.4-9'
8
+ version: '7.15.2-1'
9
9
  };