Skip to content

Commit

Permalink
fix getEnvVar non default val (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
puncsky authored Jan 6, 2021
1 parent 8469671 commit 3ad944b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/web-server/src/env-var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -19,5 +19,5 @@ export function getEnvVar(
);
}
}
return val || defaultValue;
return (val !== undefined ? val : defaultValue) || "";
}

0 comments on commit 3ad944b

Please sign in to comment.