import formatProperty from './format-property'; import {EnvironmentConfig, PropertyResult} from './types'; export default function loadEnvironmentProperty( propertyConfig: EnvironmentConfig, ): PropertyResult { const {variableName} = propertyConfig; const value = process.env[variableName]; return formatProperty( { error: typeof value !== 'string' && new Error(`${variableName} is not defined.`), value, }, propertyConfig, ); }