Skip to content

Commit

Permalink
Convert result of renderOriginShield to use ternary operator
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Lynch <nlynch@amazon.com>
  • Loading branch information
smguggen and njlynch authored Jul 29, 2021
1 parent ffb107c commit d1efb1d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/@aws-cdk/aws-cloudfront/lib/origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,9 @@ export abstract class OriginBase implements IOrigin {
* Takes origin shield region and converts to CfnDistribution.OriginShieldProperty
*/
private renderOriginShield(originShieldRegion?: string): CfnDistribution.OriginShieldProperty | undefined {
if (originShieldRegion) {
return {
enabled: true,
originShieldRegion,
};
}
return undefined;
return originShieldRegion
? { enabled: true, originShieldRegion }
: undefined;
}
}

Expand Down

0 comments on commit d1efb1d

Please sign in to comment.