import { fromJust , isNothing } from '@typed/maybe' ; import { getEnvVar } from './getEnvVar' ; export function getRequiredEnvVar ( name ) { const envVar = getEnvVar ( name ) ; if ( isNothing ( envVar ) ) { throw new Error ( `Unable to find environment variable ${ name }` ) ; } return fromJust ( envVar ) ; }