Small Enum/EnumType cleanups for consistency (#759)
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.3.4",
|
||||
"@polkadot/keyring": "^0.35.1",
|
||||
"@polkadot/util": "^0.35.1",
|
||||
"@polkadot/keyring": "^0.35.4",
|
||||
"@polkadot/util": "^0.35.4",
|
||||
"core-js": "^2.6.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,13 @@ export default class Enum extends Base<number> implements Codec {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the index for this value (equivalent to toNumber)
|
||||
*/
|
||||
get index (): number {
|
||||
return this.raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the value is an empty value (always false)
|
||||
*/
|
||||
|
||||
@@ -133,7 +133,7 @@ export default class EnumType<T> extends Base<Codec> implements Codec {
|
||||
* @description Checks if the Enum points to a [[Null]] type
|
||||
*/
|
||||
get isNone (): boolean {
|
||||
return this.raw instanceof Null;
|
||||
return this.isNull;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user