@polkadot/types-codec
Advanced tools
Comparing version 6.12.2-3 to 6.12.2-4
@@ -8,6 +8,6 @@ import type { HexString } from '@polkadot/util/types'; | ||
export declare abstract class Base<T extends Codec> implements Codec { | ||
#private; | ||
readonly registry: CodecRegistry; | ||
createdAtHash?: IU8a; | ||
readonly initialU8aLength?: number; | ||
protected readonly _raw: T; | ||
protected constructor(registry: CodecRegistry, value: T, initialU8aLength?: number); | ||
@@ -22,2 +22,3 @@ /** | ||
get hash(): IU8a; | ||
get inner(): T; | ||
/** | ||
@@ -56,2 +57,3 @@ * @description Checks if the value is an empty value | ||
toRawType(): string; | ||
unwrap(): T; | ||
} |
@@ -0,1 +1,6 @@ | ||
import _classPrivateFieldLooseBase from "@babel/runtime/helpers/esm/classPrivateFieldLooseBase"; | ||
import _classPrivateFieldLooseKey from "@babel/runtime/helpers/esm/classPrivateFieldLooseKey"; | ||
var _raw = /*#__PURE__*/_classPrivateFieldLooseKey("raw"); | ||
// Copyright 2017-2021 @polkadot/types-codec authors & contributors | ||
@@ -13,5 +18,8 @@ // SPDX-License-Identifier: Apache-2.0 | ||
this.initialU8aLength = void 0; | ||
this._raw = void 0; | ||
Object.defineProperty(this, _raw, { | ||
writable: true, | ||
value: void 0 | ||
}); | ||
this.registry = registry; | ||
this._raw = value; | ||
_classPrivateFieldLooseBase(this, _raw)[_raw] = value; | ||
this.initialU8aLength = initialU8aLength; | ||
@@ -35,2 +43,6 @@ } | ||
} | ||
get inner() { | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw]; | ||
} | ||
/** | ||
@@ -42,3 +54,3 @@ * @description Checks if the value is an empty value | ||
get isEmpty() { | ||
return this._raw.isEmpty; | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].isEmpty; | ||
} | ||
@@ -51,3 +63,3 @@ /** | ||
eq(other) { | ||
return this._raw.eq(other); | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].eq(other); | ||
} | ||
@@ -60,3 +72,3 @@ /** | ||
toHex(isLe) { | ||
return this._raw.toHex(isLe); | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].toHex(isLe); | ||
} | ||
@@ -69,3 +81,3 @@ /** | ||
toHuman(isExtended) { | ||
return this._raw.toHuman(isExtended); | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].toHuman(isExtended); | ||
} | ||
@@ -78,3 +90,3 @@ /** | ||
toJSON() { | ||
return this._raw.toJSON(); | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].toJSON(); | ||
} | ||
@@ -87,3 +99,3 @@ /** | ||
toString() { | ||
return this._raw.toString(); | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].toString(); | ||
} | ||
@@ -97,3 +109,3 @@ /** | ||
toU8a(isBare) { | ||
return this._raw.toU8a(isBare); | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw].toU8a(isBare); | ||
} | ||
@@ -109,2 +121,6 @@ /** | ||
unwrap() { | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw]; | ||
} | ||
} |
@@ -32,2 +32,6 @@ import type { HexString } from '@polkadot/util/types'; | ||
/** | ||
* @description The value of the enum | ||
*/ | ||
get inner(): Codec; | ||
/** | ||
* @description true if this is a basic enum (no values) | ||
@@ -34,0 +38,0 @@ */ |
@@ -240,2 +240,10 @@ import _classPrivateFieldLooseBase from "@babel/runtime/helpers/esm/classPrivateFieldLooseBase"; | ||
/** | ||
* @description The value of the enum | ||
*/ | ||
get inner() { | ||
return _classPrivateFieldLooseBase(this, _raw)[_raw]; | ||
} | ||
/** | ||
* @description true if this is a basic enum (no values) | ||
@@ -242,0 +250,0 @@ */ |
@@ -14,6 +14,2 @@ import type { Codec, CodecClass, CodecRegistry } from '../types'; | ||
toU8a(isBare?: boolean): Uint8Array; | ||
/** | ||
* @description Return the inner value for the wrapped type | ||
*/ | ||
unwrap(): T; | ||
} |
@@ -37,3 +37,3 @@ // Copyright 2017-2021 @polkadot/types-codec authors & contributors | ||
toRawType() { | ||
return `WrapperOpaque<${this._raw.toRawType()}>`; | ||
return `WrapperOpaque<${this.inner.toRawType()}>`; | ||
} | ||
@@ -49,11 +49,3 @@ /** | ||
} | ||
/** | ||
* @description Return the inner value for the wrapped type | ||
*/ | ||
unwrap() { | ||
return this._raw; | ||
} | ||
} |
@@ -23,3 +23,3 @@ { | ||
"type": "module", | ||
"version": "6.12.2-3", | ||
"version": "6.12.2-4", | ||
"main": "index.js", | ||
@@ -26,0 +26,0 @@ "dependencies": { |
@@ -6,3 +6,3 @@ // Copyright 2017-2021 @polkadot/types-codec authors & contributors | ||
name: '@polkadot/types-codec', | ||
version: '6.12.2-3' | ||
version: '6.12.2-4' | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
388903
11019