Skip to content

Commit

Permalink
chore: Allow for undefined keys in env
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jul 25, 2023
1 parent b8b0cfd commit 3f49911
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/express-support/src/functions.ts
Original file line number Diff line number Diff line change
@@ -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}`]
}

Expand Down

0 comments on commit 3f49911

Please sign in to comment.