Add getEnvVar.ts to convert env vars to appropriate type (or undefined)
This commit is contained in:
5
src/utils/getEnvVar.ts
Normal file
5
src/utils/getEnvVar.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const getEnvVar = (key: string) => {
|
||||
const val = process.env[key];
|
||||
if (!val) return undefined;
|
||||
else return JSON.parse(val);
|
||||
};
|
||||
Reference in New Issue
Block a user