* Bump deps

* Bump

* revamp comments

* Only use un-aliased primitives

* Revert "Only use un-aliased primitives"

This reverts commit 93d7e28f3a73351899789acc0914b75b421d4c11.
This commit is contained in:
Jaco
2021-10-08 10:31:11 +03:00
committed by GitHub
parent 068af8b2ab
commit d10407a44f
10 changed files with 530 additions and 532 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
"@babel/runtime": "^7.15.4",
"@polkadot/util": "^7.4.1",
"@polkadot/util-crypto": "^7.4.1",
"rxjs": "^7.3.0"
"rxjs": "^7.4.0"
},
"devDependencies": {
"@polkadot/keyring": "^7.4.1",
+10 -3
View File
@@ -327,10 +327,17 @@ export class TypeRegistry implements Registry {
}
public getClassName (Type: Constructor): string | undefined {
const entry = [...this.#classes.entries()].find(([, Clazz]) => Type === Clazz);
// we cannot rely on export order (anymore, since babel/core 7.15.8), so in the case of
// items such as u32 & U32, we get the lowercase versions here... not quite as optimal
// (previously this used to be a simple find & return)
const names = [...this.#classes.entries()]
.filter(([, Clazz]) => Type === Clazz)
.map(([name]) => name)
.sort()
.reverse();
return entry
? entry[0]
return names.length
? names[0]
: undefined;
}