Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
email,
host,
json,
port,
num,
str,
url,
type ValidatorSpec
} from 'envalid'
const booleanValidatorSpec: ValidatorSpec = bool()
const numberValidatorSpec: ValidatorSpec = num()
const stringValidatorSpec: ValidatorSpec = str()
const jsonValidatorSpec: ValidatorSpec = json()
const urlValidatorSpec: ValidatorSpec = url()
const emailValidatorSpec: ValidatorSpec = email()
const hostValidatorSpec: ValidatorSpec = host()
const portValidatorSpec: ValidatorSpec = port()
const env1: { NODE_ENV: string, ... } = cleanEnv({ NODE_ENV: 'TEST' }, {
NODE_ENV: str()
})
// $ExpectError
const env2: { NODE_ENV: number, ... } = cleanEnv({ NODE_ENV: 'TEST' }, {
NODE_ENV: str()
})
// $ExpectError
const invalidBooleanValidatorSpec: ValidatorSpec = bool()