chat-bot/bot/utils/throwIf.ts

7 lines
218 B
TypeScript

export const throwIfNo = (envVariable?: string) => {
const variableName = Object.keys({ envVariable })[0];
if (envVariable === undefined) {
throw new Error(`${variableName} must be provided!`);
}
}