From 3f499110661f446010a0e35f948b468138c4ede6 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Tue, 25 Jul 2023 03:43:48 +0200 Subject: [PATCH] chore: Allow for undefined keys in env --- packages/express-support/src/functions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/express-support/src/functions.ts b/packages/express-support/src/functions.ts index 2fffea807..f10fb2208 100644 --- a/packages/express-support/src/functions.ts +++ b/packages/express-support/src/functions.ts @@ -1,7 +1,10 @@ import express from 'express' import process from 'process' -export function env(key: string, prefix?: string): string | undefined { +export function env(key?: string, prefix?: string): string | undefined { + if (!key) { + return + } return process.env[`${prefix ? prefix.trim() : ''}${key}`] }