10 lines
253 B
TypeScript
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
|
|
}
|