aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/apidoc/faker-class.ts6
-rw-r--r--scripts/apidoc/signature.ts2
2 files changed, 6 insertions, 2 deletions
diff --git a/scripts/apidoc/faker-class.ts b/scripts/apidoc/faker-class.ts
index 6672896c..a9acad3c 100644
--- a/scripts/apidoc/faker-class.ts
+++ b/scripts/apidoc/faker-class.ts
@@ -28,6 +28,10 @@ export async function processFakerRandomizer(
.getChildrenByKind(ReflectionKind.Interface)
.find((clazz) => clazz.name === 'Randomizer');
+ if (randomizerClass == null) {
+ throw new Error('Randomizer class not found');
+ }
+
return processClass(randomizerClass);
}
@@ -63,7 +67,7 @@ async function processClass(
function hasConstructor(clazz: DeclarationReflection): boolean {
return clazz
.getChildrenByKind(ReflectionKind.Constructor)
- .some((constructor) => constructor.signatures.length > 0);
+ .some((constructor) => (constructor.signatures?.length ?? 0) > 0);
}
async function processConstructor(
diff --git a/scripts/apidoc/signature.ts b/scripts/apidoc/signature.ts
index 08fe5896..82d4047e 100644
--- a/scripts/apidoc/signature.ts
+++ b/scripts/apidoc/signature.ts
@@ -305,7 +305,7 @@ async function signatureTypeToText(
await Promise.all(
signature.parameters?.map(
async (p) => `${p.name}: ${await typeToText(p.type)}`
- )
+ ) ?? []
)
).join(', ')}) => ${await typeToText(signature.type)}`;
}