From d1efb1de418857c173bac2263908d2551d72fb11 Mon Sep 17 00:00:00 2001 From: Steven Guggenheimer Date: Thu, 29 Jul 2021 11:54:22 -0500 Subject: [PATCH] Convert result of renderOriginShield to use ternary operator Co-authored-by: Nick Lynch --- packages/@aws-cdk/aws-cloudfront/lib/origin.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/origin.ts b/packages/@aws-cdk/aws-cloudfront/lib/origin.ts index 5cff527aa3837..9b841e413c405 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/origin.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/origin.ts @@ -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; } }