From 3ad944b84f9aca5c6d4f6d15d6a1ca5dba192b2d Mon Sep 17 00:00:00 2001 From: Tian Pan Date: Wed, 6 Jan 2021 15:17:25 -0800 Subject: [PATCH] fix getEnvVar non default val (#157) --- packages/web-server/src/env-var.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/web-server/src/env-var.ts b/packages/web-server/src/env-var.ts index acd34836..8a6887dc 100644 --- a/packages/web-server/src/env-var.ts +++ b/packages/web-server/src/env-var.ts @@ -4,8 +4,8 @@ config(); export function getEnvVar( varName: string, - defaultValue: string, - isHardDependency = false + defaultValue?: string, + isHardDependency?: boolean ): string { const val = process.env[varName]; if (!val) { @@ -19,5 +19,5 @@ export function getEnvVar( ); } } - return val || defaultValue; + return (val !== undefined ? val : defaultValue) || ""; }