Bump deps (#4037)
* 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:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user