[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.
This commit is contained in:
HexagonSun
2021-04-06 07:21:11 +02:00
committed by GitHub
parent c3b7ecff21
commit acedd1cfba

View File

@@ -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}}