Compare commits
2 Commits
9e72e98232
...
1.0.16
| Author | SHA1 | Date | |
|---|---|---|---|
|
772e404b2a
|
|||
|
19b3de3905
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mifi/services-common",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.16",
|
||||
"author": "mifi (Mike Fitzpatrick)",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export const getEnvVar = (key: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const getEnvVar = <T = any>(key: string, defaultValue: T): T => {
|
||||
const val = process.env[key];
|
||||
if (!val) return undefined;
|
||||
else return JSON.parse(val);
|
||||
if (!val) return defaultValue as T;
|
||||
else return val as T;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user