refactor(aio): add assertNotMissingOrEmpty()
helper
This commit is contained in:

committed by
Chuck Jazdzewski

parent
c8d87a936b
commit
c5644e5a0d
@ -1,4 +1,10 @@
|
||||
// Functions
|
||||
export const assertNotMissingOrEmpty = (name: string, value: string | null | undefined) => {
|
||||
if (!value) {
|
||||
throw new Error(`Missing or empty required parameter '${name}'!`);
|
||||
}
|
||||
};
|
||||
|
||||
export const getEnvVar = (name: string, isOptional = false): string => {
|
||||
const value = process.env[name];
|
||||
|
||||
|
Reference in New Issue
Block a user