import { CleanedEnvAccessors , CleanOptions , ValidatorSpec } from './types' ; import { getSanitizedEnv , testOnlySymbol } from './core' ; import { applyDefaultMiddleware } from './middleware' ; param environment param specs param options export function cleanEnv < T > ( environment , specs , options = { } ) { const cleaned = getSanitizedEnv ( environment , specs , options ) ; return Object . freeze ( applyDefaultMiddleware ( cleaned , environment ) ) ; } param environment param specs param applyMiddleware param options export function customCleanEnv < T , MW > ( environment , specs , applyMiddleware , options = { } ) { const cleaned = getSanitizedEnv ( environment , specs , options ) ; return Object . freeze ( applyMiddleware ( cleaned , environment ) ) ; } /**
 * Utility function for providing default values only when NODE_ENV=test
 *
 * For more context, see https://github.com/af/envalid/issues/32
 */ export const testOnly = < T > ( defaultValueForTests ) => { return process . env . NODE_ENV === 'test' ? defaultValueForTests : ( testOnlySymbol as unknown as T ) ; } ;