Skip to content

Commit 673d67c

Browse files
committed
refactor(typescript-rxjs): destructure configuration in BaseApi
1 parent 7056095 commit 673d67c

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ export class Configuration {
3535
}
3636

3737
get apiKey(): ((name: string) => string) | undefined {
38-
const apiKey = this.configuration.apiKey;
38+
const { apiKey } = this.configuration;
3939
return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey);
4040
}
4141

4242
get accessToken(): ((name: string, scopes?: string[]) => string) | undefined {
43-
const accessToken = this.configuration.accessToken;
43+
const { accessToken } = this.configuration;
4444
return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken);
4545
}
4646
}

samples/client/petstore/typescript-rxjs/builds/default/runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export class Configuration {
4646
}
4747

4848
get apiKey(): ((name: string) => string) | undefined {
49-
const apiKey = this.configuration.apiKey;
49+
const { apiKey } = this.configuration;
5050
return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey);
5151
}
5252

5353
get accessToken(): ((name: string, scopes?: string[]) => string) | undefined {
54-
const accessToken = this.configuration.accessToken;
54+
const { accessToken } = this.configuration;
5555
return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken);
5656
}
5757
}

samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export class Configuration {
4646
}
4747

4848
get apiKey(): ((name: string) => string) | undefined {
49-
const apiKey = this.configuration.apiKey;
49+
const { apiKey } = this.configuration;
5050
return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey);
5151
}
5252

5353
get accessToken(): ((name: string, scopes?: string[]) => string) | undefined {
54-
const accessToken = this.configuration.accessToken;
54+
const { accessToken } = this.configuration;
5555
return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken);
5656
}
5757
}

samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export class Configuration {
4646
}
4747

4848
get apiKey(): ((name: string) => string) | undefined {
49-
const apiKey = this.configuration.apiKey;
49+
const { apiKey } = this.configuration;
5050
return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey);
5151
}
5252

5353
get accessToken(): ((name: string, scopes?: string[]) => string) | undefined {
54-
const accessToken = this.configuration.accessToken;
54+
const { accessToken } = this.configuration;
5555
return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken);
5656
}
5757
}

samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export class Configuration {
4646
}
4747

4848
get apiKey(): ((name: string) => string) | undefined {
49-
const apiKey = this.configuration.apiKey;
49+
const { apiKey } = this.configuration;
5050
return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey);
5151
}
5252

5353
get accessToken(): ((name: string, scopes?: string[]) => string) | undefined {
54-
const accessToken = this.configuration.accessToken;
54+
const { accessToken } = this.configuration;
5555
return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken);
5656
}
5757
}

0 commit comments

Comments
 (0)