inital commit
This commit is contained in:
15
packages/utils/src/envVariables.ts
Normal file
15
packages/utils/src/envVariables.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Checks if all environment variables are set
|
||||
*
|
||||
* @param variables the environment variables to check
|
||||
* @returns true if all variables are set, false otherwise
|
||||
*/
|
||||
export function checkEnvironmentVariables(...variables: string[]): boolean {
|
||||
let allVariablesSet = true;
|
||||
variables.forEach((variable) => {
|
||||
if (!process.env[variable]) {
|
||||
throw new Error(`${variable} not set in environment variables`);
|
||||
}
|
||||
});
|
||||
return allVariablesSet;
|
||||
}
|
Reference in New Issue
Block a user