diff options
| author | ST-DDT <[email protected]> | 2023-11-14 17:11:26 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-14 16:11:26 +0000 |
| commit | 7e3c92e802614ae5e9f621d9e679dfd6f6d63cf1 (patch) | |
| tree | bb6813a857c0c42ba1049be5035fce7f45b99c46 /scripts | |
| parent | 36fc517d17591c8ea1d5135d9a93c7591e3d1f74 (diff) | |
| download | faker-7e3c92e802614ae5e9f621d9e679dfd6f6d63cf1.tar.xz faker-7e3c92e802614ae5e9f621d9e679dfd6f6d63cf1.zip | |
infra: enable strictNullChecks in tsconfig (#2435)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/apidoc/faker-class.ts | 6 | ||||
| -rw-r--r-- | scripts/apidoc/signature.ts | 2 |
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)}`; } |
