v9.1.0
envaptType aliases

ConverterFunction

type ConverterFunction<TReturn> = (raw) => TReturn & object;

Custom converter for an environment variable or an array element. It receives a present value with templates already expanded. envapt applies the fallback itself. A return of undefined or null means the value could not be converted. From getAs and an optional @Envapt, an error the converter throws propagates to the caller unchanged. A required read reports it as an InvalidEnvValue issue carrying its message.

Type Parameters

Type ParameterDefault type
TReturnunknown

Type Declaration

NameType
~standard?never
prototype?undefined

See

https://envapt.materwelon.dev/docs/converters#custom-converters

On this page