Skip to content

Commit

Permalink
chore(appconfig): compilation error in ts 4.2 and below because of us…
Browse files Browse the repository at this point in the history
…ing get in interface (aws#29226)

### Reason for this change

There is a lint error which `get` syntax can't be used on interface before TS version 4.3

### Description of changes

Replace `get` with a regular function.

### Description of how you validated changes

Unit test passed.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
xazhao authored Feb 22, 2024
1 parent 6c17ca5 commit fcb7231
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-appconfig/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface IApplication extends cdk.IResource {
/**
* Returns the list of associated environments.
*/
get environments(): IEnvironment[];
environments(): IEnvironment[];

/**
* Adds an extension defined by the action point and event destination
Expand Down Expand Up @@ -204,7 +204,7 @@ abstract class ApplicationBase extends cdk.Resource implements IApplication, IEx
this._environments.push(environment);
}

get environments(): IEnvironment[] {
public environments(): IEnvironment[] {
return this._environments;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE

protected addExistingEnvironmentsToApplication() {
this.deployTo?.forEach((environment) => {
if (!this.application.environments.includes(environment)) {
if (!this.application.environments().includes(environment)) {
this.application.addExistingEnvironment(environment);
}
});
Expand All @@ -315,7 +315,7 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE
return;
}

this.application.environments.forEach((environment) => {
this.application.environments().forEach((environment) => {
if ((this.deployTo && !this.deployTo.includes(environment))) {
return;
}
Expand Down

0 comments on commit fcb7231

Please sign in to comment.