Skip to content

Commit

Permalink
fix(core): updatedProperties function name is misspelled (#21071)
Browse files Browse the repository at this point in the history
This PR only fix typo in the name of protected function.

`Properites` -> `Properties`

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
michimani committed Jul 14, 2022
1 parent bd53ca4 commit 7b389f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/@aws-cdk/core/lib/cfn-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ export class CfnResource extends CfnRefElement {
}

/**
* Deprecated
* @deprecated use `updatedProperties`
*
* Return properties modified after initiation
*
* Resources that expose mutable properties should override this function to
Expand All @@ -440,6 +443,16 @@ export class CfnResource extends CfnRefElement {
return this._cfnProperties;
}

/**
* Return properties modified after initiation
*
* Resources that expose mutable properties should override this function to
* collect and return the properties object for this resource.
*/
protected get updatedProperties(): { [key: string]: any } {
return this._cfnProperties;
}

protected validateProperties(_properties: any) {
// Nothing
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/core/test/resource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,15 +948,15 @@ class CustomizableResource extends CfnResource {
}

public renderProperties(): { [key: string]: any } {
const props = this.updatedProperites;
const props = this.updatedProperties;
const render: { [key: string]: any } = {};
for (const key of Object.keys(props)) {
render[key.toUpperCase()] = props[key];
}
return render;
}

protected get updatedProperites(): { [key: string]: any } {
protected get updatedProperties(): { [key: string]: any } {
const props: { [key: string]: any } = {
prop1: this.prop1,
prop2: this.prop2,
Expand Down

0 comments on commit 7b389f0

Please sign in to comment.