Move .isEmpty to $isEmpty (#5424)

* Move .isEmpty to $isEmpty

* Adjust usages
This commit is contained in:
Jaco
2023-01-19 11:07:29 +02:00
committed by GitHub
parent 4688291ecf
commit 6f19084a4d
66 changed files with 249 additions and 146 deletions
+1 -1
View File
@@ -232,7 +232,7 @@ function addConstants ({ lookup, pallets }: MetadataLatest): string {
description: DESC_CONSTANTS,
sections: pallets
.sort(sortByName)
.filter(({ constants }) => !constants.isEmpty)
.filter(({ constants }) => !constants.$isEmpty)
.map(({ constants, name }) => {
const sectionName = stringLowerFirst(name);
+2 -2
View File
@@ -67,10 +67,10 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
}
}
} else if (isChildClass(Enum, Clazz)) {
const { defKeys, isBasic } = new (Clazz as Constructor)(registry) as Enum;
const { $isBasic, defKeys } = new (Clazz as Constructor)(registry) as Enum;
const keys = defKeys.filter((v) => !v.startsWith('__Unused'));
if (isBasic) {
if ($isBasic) {
possibleTypes.push(arrayToStrType(keys), 'number');
} else {
// TODO We don't really want any here, these should be expanded