mic-bot/utils/env.ts
2024-10-19 12:00:35 +02:00

10 lines
253 B
TypeScript

import { BadConfigErr } from "./errors.ts";
export const mustGetEnv = (envName: string): string => {
const env = Deno.env.get(envName)
if (!env) {
throw new BadConfigErr(`required environment variable ${envName} wasn't set`)
}
return env
}