@polkadot/types-codec 8.8.3-4 → 8.8.3-5

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.
File without changes
File without changes
@@ -4,7 +4,7 @@ import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types
4
4
  * @name Base
5
5
  * @description A type extends the Base class, when it holds a value
6
6
  */
7
- export declare abstract class Base<T extends Codec> implements Codec {
7
+ export declare abstract class AbstractBase<T extends Codec> implements Codec {
8
8
  #private;
9
9
  createdAtHash?: IU8a;
10
10
  readonly initialU8aLength?: number;
@@ -5,7 +5,7 @@
5
5
  * @name Base
6
6
  * @description A type extends the Base class, when it holds a value
7
7
  */
8
- export class Base {
8
+ export class AbstractBase {
9
9
  #raw;
10
10
 
11
11
  constructor(registry, value, initialU8aLength) {
File without changes
File without changes
@@ -1,2 +1,3 @@
1
- export { AbstractArray } from './AbstractArray';
2
- export { AbstractInt } from './AbstractInt';
1
+ export { AbstractArray } from './Array';
2
+ export { AbstractBase } from './Base';
3
+ export { AbstractInt } from './Int';
package/abstract/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { AbstractArray } from "./AbstractArray.js";
4
- export { AbstractInt } from "./AbstractInt.js";
3
+ export { AbstractArray } from "./Array.js";
4
+ export { AbstractBase } from "./Base.js";
5
+ export { AbstractInt } from "./Int.js";
package/base/Int.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types';
2
- import { AbstractInt } from '../abstract/AbstractInt';
2
+ import { AbstractInt } from '../abstract/Int';
3
3
  /**
4
4
  * @name Int
5
5
  * @description
package/base/Int.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 { AbstractInt } from "../abstract/AbstractInt.js";
3
+ import { AbstractInt } from "../abstract/Int.js";
4
4
  /**
5
5
  * @name Int
6
6
  * @description
package/base/Tuple.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types';
2
- import { AbstractArray } from '../abstract/AbstractArray';
2
+ import { AbstractArray } from '../abstract/Array';
3
3
  declare type TupleType = (CodecClass | string);
4
4
  declare type TupleTypes = TupleType[] | {
5
5
  [index: string]: CodecClass | string;
package/base/Tuple.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { isFunction, isHex, isString, isU8a, stringify, u8aConcatStrict, u8aToU8a } from '@polkadot/util';
4
- import { AbstractArray } from "../abstract/AbstractArray.js";
4
+ import { AbstractArray } from "../abstract/Array.js";
5
5
  import { decodeU8a, mapToTypeMap, typeToConstructor } from "../utils/index.js";
6
6
 
7
7
  function noopSetDefinition(d) {
package/base/UInt.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { CodecClass, UIntBitLength } from '../types';
2
- import { AbstractInt } from '../abstract/AbstractInt';
2
+ import { AbstractInt } from '../abstract/Int';
3
3
  /**
4
4
  * @name UInt
5
5
  * @description
package/base/UInt.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 { AbstractInt } from "../abstract/AbstractInt.js";
3
+ import { AbstractInt } from "../abstract/Int.js";
4
4
  /**
5
5
  * @name UInt
6
6
  * @description
package/base/Vec.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
2
  import type { Codec, CodecClass, Registry } from '../types';
3
- import { AbstractArray } from '../abstract/AbstractArray';
3
+ import { AbstractArray } from '../abstract/Array';
4
4
  interface Options<T> {
5
5
  definition?: CodecClass<T>;
6
6
  setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
package/base/Vec.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { assert, compactFromU8aLim, isU8a, logger, u8aToU8a } from '@polkadot/util';
4
- import { AbstractArray } from "../abstract/AbstractArray.js";
4
+ import { AbstractArray } from "../abstract/Array.js";
5
5
  import { decodeU8aVec, typeToConstructor } from "../utils/index.js";
6
6
  const MAX_LENGTH = 64 * 1024;
7
7
  const l = logger('Vec');
package/base/VecAny.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Codec } from '../types';
2
- import { AbstractArray } from '../abstract/AbstractArray';
2
+ import { AbstractArray } from '../abstract/Array';
3
3
  /**
4
4
  * @name VecAny
5
5
  * @description
package/base/VecAny.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 { AbstractArray } from "../abstract/AbstractArray.js";
3
+ import { AbstractArray } from "../abstract/Array.js";
4
4
  /**
5
5
  * @name VecAny
6
6
  * @description
@@ -1,6 +1,6 @@
1
1
  import type { HexString } from '@polkadot/util/types';
2
2
  import type { Codec, CodecClass, Inspect, Registry } from '../types';
3
- import { AbstractArray } from '../abstract/AbstractArray';
3
+ import { AbstractArray } from '../abstract/Array';
4
4
  interface Options<T> {
5
5
  definition?: CodecClass<T>;
6
6
  setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
package/base/VecFixed.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { isU8a, u8aConcatStrict } from '@polkadot/util';
4
- import { AbstractArray } from "../abstract/AbstractArray.js";
4
+ import { AbstractArray } from "../abstract/Array.js";
5
5
  import { decodeU8aVec, typeToConstructor } from "../utils/index.js";
6
6
  import { decodeVec } from "./Vec.js";
7
7
 
package/base/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { Base } from './Base';
2
1
  export { Compact } from './Compact';
3
2
  export { DoNotConstruct } from './DoNotConstruct';
4
3
  export { Enum } from './Enum';
package/base/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { Base } from "./Base.js";
4
3
  export { Compact } from "./Compact.js";
5
4
  export { DoNotConstruct } from "./DoNotConstruct.js";
6
5
  export { Enum } from "./Enum.js";
File without changes
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Base = void 0;
6
+ exports.AbstractBase = void 0;
7
7
 
8
8
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
9
9
  // SPDX-License-Identifier: Apache-2.0
@@ -12,7 +12,7 @@ exports.Base = void 0;
12
12
  * @name Base
13
13
  * @description A type extends the Base class, when it holds a value
14
14
  */
15
- class Base {
15
+ class AbstractBase {
16
16
  #raw;
17
17
 
18
18
  constructor(registry, value, initialU8aLength) {
@@ -120,4 +120,4 @@ class Base {
120
120
 
121
121
  }
122
122
 
123
- exports.Base = Base;
123
+ exports.AbstractBase = AbstractBase;
File without changes
@@ -6,16 +6,24 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "AbstractArray", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _AbstractArray.AbstractArray;
9
+ return _Array.AbstractArray;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "AbstractBase", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Base.AbstractBase;
10
16
  }
11
17
  });
12
18
  Object.defineProperty(exports, "AbstractInt", {
13
19
  enumerable: true,
14
20
  get: function () {
15
- return _AbstractInt.AbstractInt;
21
+ return _Int.AbstractInt;
16
22
  }
17
23
  });
18
24
 
19
- var _AbstractArray = require("./AbstractArray");
25
+ var _Array = require("./Array");
26
+
27
+ var _Base = require("./Base");
20
28
 
21
- var _AbstractInt = require("./AbstractInt");
29
+ var _Int = require("./Int");
package/cjs/base/Int.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Int = void 0;
7
7
 
8
- var _AbstractInt = require("../abstract/AbstractInt");
8
+ var _Int = require("../abstract/Int");
9
9
 
10
10
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
11
11
  // SPDX-License-Identifier: Apache-2.0
@@ -20,7 +20,7 @@ var _AbstractInt = require("../abstract/AbstractInt");
20
20
  * is available here.
21
21
  * @noInheritDoc
22
22
  */
23
- class Int extends _AbstractInt.AbstractInt {
23
+ class Int extends _Int.AbstractInt {
24
24
  constructor(registry) {
25
25
  let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
26
26
  let bitLength = arguments.length > 2 ? arguments[2] : undefined;
package/cjs/base/Tuple.js CHANGED
@@ -7,7 +7,7 @@ exports.Tuple = void 0;
7
7
 
8
8
  var _util = require("@polkadot/util");
9
9
 
10
- var _AbstractArray = require("../abstract/AbstractArray");
10
+ var _Array = require("../abstract/Array");
11
11
 
12
12
  var _utils = require("../utils");
13
13
 
@@ -45,7 +45,7 @@ function decodeTuple(registry, result, value, Classes) {
45
45
  */
46
46
 
47
47
 
48
- class Tuple extends _AbstractArray.AbstractArray {
48
+ class Tuple extends _Array.AbstractArray {
49
49
  #Types;
50
50
 
51
51
  constructor(registry, Types, value) {
package/cjs/base/UInt.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.UInt = void 0;
7
7
 
8
- var _AbstractInt = require("../abstract/AbstractInt");
8
+ var _Int = require("../abstract/Int");
9
9
 
10
10
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
11
11
  // SPDX-License-Identifier: Apache-2.0
@@ -20,7 +20,7 @@ var _AbstractInt = require("../abstract/AbstractInt");
20
20
  * is available here.
21
21
  * @noInheritDoc
22
22
  */
23
- class UInt extends _AbstractInt.AbstractInt {
23
+ class UInt extends _Int.AbstractInt {
24
24
  static with(bitLength, typeName) {
25
25
  return class extends UInt {
26
26
  constructor(registry, value) {
package/cjs/base/Vec.js CHANGED
@@ -8,7 +8,7 @@ exports.decodeVec = decodeVec;
8
8
 
9
9
  var _util = require("@polkadot/util");
10
10
 
11
- var _AbstractArray = require("../abstract/AbstractArray");
11
+ var _Array = require("../abstract/Array");
12
12
 
13
13
  var _utils = require("../utils");
14
14
 
@@ -61,7 +61,7 @@ function decodeVec(registry, result, value, startAt, Type) {
61
61
  */
62
62
 
63
63
 
64
- class Vec extends _AbstractArray.AbstractArray {
64
+ class Vec extends _Array.AbstractArray {
65
65
  #Type;
66
66
 
67
67
  constructor(registry, Type) {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.VecAny = void 0;
7
7
 
8
- var _AbstractArray = require("../abstract/AbstractArray");
8
+ var _Array = require("../abstract/Array");
9
9
 
10
10
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
11
11
  // SPDX-License-Identifier: Apache-2.0
@@ -17,7 +17,7 @@ var _AbstractArray = require("../abstract/AbstractArray");
17
17
  * a vector, this can be used to manage array-like structures with variable arguments of
18
18
  * any types
19
19
  */
20
- class VecAny extends _AbstractArray.AbstractArray {
20
+ class VecAny extends _Array.AbstractArray {
21
21
  /**
22
22
  * @description Returns the base runtime type name for this instance
23
23
  */
@@ -7,7 +7,7 @@ exports.VecFixed = void 0;
7
7
 
8
8
  var _util = require("@polkadot/util");
9
9
 
10
- var _AbstractArray = require("../abstract/AbstractArray");
10
+ var _Array = require("../abstract/Array");
11
11
 
12
12
  var _utils = require("../utils");
13
13
 
@@ -25,7 +25,7 @@ function noopSetDefinition(d) {
25
25
  */
26
26
 
27
27
 
28
- class VecFixed extends _AbstractArray.AbstractArray {
28
+ class VecFixed extends _Array.AbstractArray {
29
29
  #Type;
30
30
 
31
31
  constructor(registry, Type, length) {
package/cjs/base/index.js CHANGED
@@ -3,12 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Base", {
7
- enumerable: true,
8
- get: function () {
9
- return _Base.Base;
10
- }
11
- });
12
6
  Object.defineProperty(exports, "Compact", {
13
7
  enumerable: true,
14
8
  get: function () {
@@ -82,8 +76,6 @@ Object.defineProperty(exports, "VecFixed", {
82
76
  }
83
77
  });
84
78
 
85
- var _Base = require("./Base");
86
-
87
79
  var _Compact = require("./Compact");
88
80
 
89
81
  var _DoNotConstruct = require("./DoNotConstruct");
@@ -7,7 +7,7 @@ exports.CodecMap = void 0;
7
7
 
8
8
  var _util = require("@polkadot/util");
9
9
 
10
- var _AbstractArray = require("../abstract/AbstractArray");
10
+ var _Array = require("../abstract/Array");
11
11
 
12
12
  var _Enum = require("../base/Enum");
13
13
 
@@ -44,7 +44,7 @@ function decodeMapFromMap(registry, KeyClass, ValClass, value) {
44
44
  const output = new Map();
45
45
 
46
46
  for (const [key, val] of value.entries()) {
47
- const isComplex = KeyClass.prototype instanceof _AbstractArray.AbstractArray || KeyClass.prototype instanceof _Struct.Struct || KeyClass.prototype instanceof _Enum.Enum;
47
+ const isComplex = KeyClass.prototype instanceof _Array.AbstractArray || KeyClass.prototype instanceof _Struct.Struct || KeyClass.prototype instanceof _Enum.Enum;
48
48
 
49
49
  try {
50
50
  output.set(key instanceof KeyClass ? key : new KeyClass(registry, isComplex ? JSON.parse(key) : key), val instanceof ValClass ? val : new ValClass(registry, val));
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/types-codec',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '8.8.3-4'
14
+ version: '8.8.3-5'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
package/extended/Map.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { compactFromU8aLim, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
4
- import { AbstractArray } from "../abstract/AbstractArray.js";
4
+ import { AbstractArray } from "../abstract/Array.js";
5
5
  import { Enum } from "../base/Enum.js";
6
6
  import { Struct } from "../native/Struct.js";
7
7
  import { compareMap, decodeU8a, sortMap, typeToConstructor } from "../utils/index.js";
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./cjs/detectPackage.js"
21
21
  ],
22
22
  "type": "module",
23
- "version": "8.8.3-4",
23
+ "version": "8.8.3-5",
24
24
  "main": "./cjs/index.js",
25
25
  "module": "./index.js",
26
26
  "types": "./index.d.ts",
@@ -37,26 +37,26 @@
37
37
  "require": "./cjs/abstract/index.js",
38
38
  "default": "./abstract/index.js"
39
39
  },
40
- "./abstract/AbstractArray": {
41
- "types": "./abstract/AbstractArray.d.ts",
42
- "require": "./cjs/abstract/AbstractArray.js",
43
- "default": "./abstract/AbstractArray.js"
40
+ "./abstract/Array": {
41
+ "types": "./abstract/Array.d.ts",
42
+ "require": "./cjs/abstract/Array.js",
43
+ "default": "./abstract/Array.js"
44
44
  },
45
- "./abstract/AbstractInt": {
46
- "types": "./abstract/AbstractInt.d.ts",
47
- "require": "./cjs/abstract/AbstractInt.js",
48
- "default": "./abstract/AbstractInt.js"
45
+ "./abstract/Base": {
46
+ "types": "./abstract/Base.d.ts",
47
+ "require": "./cjs/abstract/Base.js",
48
+ "default": "./abstract/Base.js"
49
+ },
50
+ "./abstract/Int": {
51
+ "types": "./abstract/Int.d.ts",
52
+ "require": "./cjs/abstract/Int.js",
53
+ "default": "./abstract/Int.js"
49
54
  },
50
55
  "./base": {
51
56
  "types": "./base/index.d.ts",
52
57
  "require": "./cjs/base/index.js",
53
58
  "default": "./base/index.js"
54
59
  },
55
- "./base/Base": {
56
- "types": "./base/Base.d.ts",
57
- "require": "./cjs/base/Base.js",
58
- "default": "./base/Base.js"
59
- },
60
60
  "./base/Compact": {
61
61
  "types": "./base/Compact.d.ts",
62
62
  "require": "./cjs/base/Compact.js",
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.8.3-4'
8
+ version: '8.8.3-5'
9
9
  };