From acedd1cfba00bd4b9aa433154d823229656bd4b9 Mon Sep 17 00:00:00 2001 From: HexagonSun Date: Tue, 6 Apr 2021 07:21:11 +0200 Subject: [PATCH] [typescript-angular] Provide return value for all code paths (#9174) (#9176) In order to avoid a compiler error when using `noImplicitReturns `, we change the mustache template to use provide a return value for the if- and else branch. Fixes #9174. --- .../resources/typescript-angular/configuration.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index e3a5e82438..02632f0c64 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -70,9 +70,9 @@ export class {{configurationClassName}} { {{#isBasic}} {{#isBasicBasic}} this.credentials['{{name}}'] = () => { - if (this.username || this.password) { - return btoa(this.username + ':' + this.password); - } + return (this.username || this.password) + ? btoa(this.username + ':' + this.password) + : undefined; }; {{/isBasicBasic}} {{#isBasicBearer}}