From 6cb5aa25f676c7f43fd543e1738e71f54ea5fc6f Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 10 Oct 2023 17:07:01 +0200 Subject: infra(unicorn): explicit-length-check (#2455) --- scripts/apidoc/signature.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/apidoc/signature.ts b/scripts/apidoc/signature.ts index b7c23842..fe11c78d 100644 --- a/scripts/apidoc/signature.ts +++ b/scripts/apidoc/signature.ts @@ -64,7 +64,7 @@ export async function analyzeSignature( // Generate usage section let signatureTypeParametersString = ''; - if (signatureTypeParameters.length !== 0) { + if (signatureTypeParameters.length > 0) { signatureTypeParametersString = `<${signatureTypeParameters.join(', ')}>`; } @@ -207,7 +207,7 @@ async function typeToText(type_?: Type, short = false): Promise { .join(' | '); case 'reference': - if (!type.typeArguments || !type.typeArguments.length) { + if (!type.typeArguments || type.typeArguments.length === 0) { const reflection = type.reflection as DeclarationReflection | undefined; const reflectionType = reflection?.type; if ( -- cgit v1.2.3