@polkadot/types-codec 7.4.2-7 → 7.5.2-0

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/native/Text.js CHANGED
@@ -1,5 +1,3 @@
1
- import _classPrivateFieldLooseBase from "@babel/runtime/helpers/esm/classPrivateFieldLooseBase";
2
- import _classPrivateFieldLooseKey from "@babel/runtime/helpers/esm/classPrivateFieldLooseKey";
3
1
  // Copyright 2017-2022 @polkadot/types-codec authors & contributors
4
2
  // SPDX-License-Identifier: Apache-2.0
5
3
  import { assert, compactAddLength, compactFromU8a, hexToU8a, isHex, isString, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
@@ -42,26 +40,15 @@ function decodeText(value) {
42
40
  // - Strings should probably be trimmed (docs do come through with extra padding)
43
41
 
44
42
 
45
- var _initialU8aLength = /*#__PURE__*/_classPrivateFieldLooseKey("initialU8aLength");
46
-
47
- var _override = /*#__PURE__*/_classPrivateFieldLooseKey("override");
48
-
49
43
  export class Text extends String {
44
+ #initialU8aLength;
45
+ #override = null;
46
+
50
47
  constructor(registry, value) {
51
48
  const [str, decodedLength] = decodeText(value);
52
49
  super(str);
53
- this.registry = void 0;
54
- this.createdAtHash = void 0;
55
- Object.defineProperty(this, _initialU8aLength, {
56
- writable: true,
57
- value: void 0
58
- });
59
- Object.defineProperty(this, _override, {
60
- writable: true,
61
- value: null
62
- });
63
50
  this.registry = registry;
64
- _classPrivateFieldLooseBase(this, _initialU8aLength)[_initialU8aLength] = decodedLength;
51
+ this.#initialU8aLength = decodedLength;
65
52
  }
66
53
  /**
67
54
  * @description The length of the value when encoded as a Uint8Array
@@ -77,7 +64,7 @@ export class Text extends String {
77
64
 
78
65
 
79
66
  get initialU8aLength() {
80
- return _classPrivateFieldLooseBase(this, _initialU8aLength)[_initialU8aLength];
67
+ return this.#initialU8aLength;
81
68
  }
82
69
  /**
83
70
  * @description returns a hash of the contents
@@ -118,7 +105,7 @@ export class Text extends String {
118
105
 
119
106
 
120
107
  setOverride(override) {
121
- _classPrivateFieldLooseBase(this, _override)[_override] = override;
108
+ this.#override = override;
122
109
  }
123
110
  /**
124
111
  * @description Returns a hex string representation of the value
@@ -160,7 +147,7 @@ export class Text extends String {
160
147
 
161
148
 
162
149
  toString() {
163
- return _classPrivateFieldLooseBase(this, _override)[_override] || super.toString();
150
+ return this.#override || super.toString();
164
151
  }
165
152
  /**
166
153
  * @description Encodes the value as a Uint8Array as per the SCALE specifications
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./detectPackage.cjs"
21
21
  ],
22
22
  "type": "module",
23
- "version": "7.4.2-7",
23
+ "version": "7.5.2-0",
24
24
  "main": "index.cjs",
25
25
  "module": "index.js",
26
26
  "types": "index.d.ts",
@@ -400,6 +400,6 @@
400
400
  },
401
401
  "dependencies": {
402
402
  "@babel/runtime": "^7.16.7",
403
- "@polkadot/util": "^8.3.2"
403
+ "@polkadot/util": "^8.3.3"
404
404
  }
405
405
  }
package/packageInfo.cjs CHANGED
@@ -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: '7.4.2-7'
14
+ version: '7.5.2-0'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
package/packageInfo.js CHANGED
@@ -5,5 +5,5 @@ export const packageInfo = {
5
5
  name: '@polkadot/types-codec',
6
6
  path: new URL('.', import.meta.url).pathname,
7
7
  type: 'esm',
8
- version: '7.4.2-7'
8
+ version: '7.5.2-0'
9
9
  };
package/primitive/I128.js CHANGED
@@ -8,9 +8,6 @@ import { Int } from "../base/Int.js";
8
8
  */
9
9
 
10
10
  export class i128 extends Int.with(128) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__IntType = 'i128';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __IntType = 'i128';
16
13
  }
package/primitive/I16.js CHANGED
@@ -8,9 +8,6 @@ import { Int } from "../base/Int.js";
8
8
  */
9
9
 
10
10
  export class i16 extends Int.with(16) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__IntType = 'i16';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __IntType = 'i16';
16
13
  }
package/primitive/I256.js CHANGED
@@ -8,9 +8,6 @@ import { Int } from "../base/Int.js";
8
8
  */
9
9
 
10
10
  export class i256 extends Int.with(256) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__IntType = 'i256';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __IntType = 'i256';
16
13
  }
package/primitive/I32.js CHANGED
@@ -8,9 +8,6 @@ import { Int } from "../base/Int.js";
8
8
  */
9
9
 
10
10
  export class i32 extends Int.with(32) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__IntType = 'i32';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __IntType = 'i32';
16
13
  }
package/primitive/I64.js CHANGED
@@ -8,9 +8,6 @@ import { Int } from "../base/Int.js";
8
8
  */
9
9
 
10
10
  export class i64 extends Int.with(64) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__IntType = 'i64';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __IntType = 'i64';
16
13
  }
package/primitive/I8.js CHANGED
@@ -8,9 +8,6 @@ import { Int } from "../base/Int.js";
8
8
  */
9
9
 
10
10
  export class i8 extends Int.with(8) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__IntType = 'i8';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __IntType = 'i8';
16
13
  }
package/primitive/U128.js CHANGED
@@ -8,9 +8,6 @@ import { UInt } from "../base/UInt.js";
8
8
  */
9
9
 
10
10
  export class u128 extends UInt.with(128) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__UIntType = 'u128';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __UIntType = 'u128';
16
13
  }
package/primitive/U16.js CHANGED
@@ -8,9 +8,6 @@ import { UInt } from "../base/UInt.js";
8
8
  */
9
9
 
10
10
  export class u16 extends UInt.with(16) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__UIntType = 'u16';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __UIntType = 'u16';
16
13
  }
package/primitive/U256.js CHANGED
@@ -8,9 +8,6 @@ import { UInt } from "../base/UInt.js";
8
8
  */
9
9
 
10
10
  export class u256 extends UInt.with(256) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__UIntType = 'u256';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __UIntType = 'u256';
16
13
  }
package/primitive/U32.js CHANGED
@@ -8,9 +8,6 @@ import { UInt } from "../base/UInt.js";
8
8
  */
9
9
 
10
10
  export class u32 extends UInt.with(32) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__UIntType = 'u32';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __UIntType = 'u32';
16
13
  }
package/primitive/U64.js CHANGED
@@ -8,9 +8,6 @@ import { UInt } from "../base/UInt.js";
8
8
  */
9
9
 
10
10
  export class u64 extends UInt.with(64) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__UIntType = 'u64';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __UIntType = 'u64';
16
13
  }
package/primitive/U8.js CHANGED
@@ -8,9 +8,6 @@ import { UInt } from "../base/UInt.js";
8
8
  */
9
9
 
10
10
  export class u8 extends UInt.with(8) {
11
- constructor(...args) {
12
- super(...args);
13
- this.__UIntType = 'u8';
14
- }
15
-
11
+ // NOTE without this, we cannot properly determine extensions
12
+ __UIntType = 'u8';
16
13
  }