From ede6ffac383a853c12b7a47cebbb031ba80627aa Mon Sep 17 00:00:00 2001 From: Shinigami Date: Wed, 3 May 2023 08:18:58 +0200 Subject: test: prepare test sources for strict mode (#2107) --- test/scripts/apidoc/signature.example.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/scripts') diff --git a/test/scripts/apidoc/signature.example.ts b/test/scripts/apidoc/signature.example.ts index 97db90c8..6bb835c1 100644 --- a/test/scripts/apidoc/signature.example.ts +++ b/test/scripts/apidoc/signature.example.ts @@ -94,7 +94,7 @@ export class SignatureTest { * @param b The string parameter. */ optionalStringParamMethod(b?: string): number { - return +b; + return b ? 0 : 1; } /** @@ -114,7 +114,7 @@ export class SignatureTest { * @param c The boolean parameter. */ multiParamMethod(a: number, b?: string, c: boolean = true): number { - return c ? a : +b; + return c ? a : b ? 0 : 1; } /** @@ -143,7 +143,7 @@ export class SignatureTest { excludes?: ReadonlyArray; } ): string { - return value + options.format; + return options?.format ?? value; } /** @@ -195,7 +195,7 @@ export class SignatureTest { */ e: LiteralUnion<'a' | 'b'>; }): number { - return options.c ? options.a : +options.b; + return options.a; } /** -- cgit v1.2.3