dotenv-validator
Version:
24 lines (23 loc) • 645 B
TypeScript
export declare type IEnvValidator = (value: string) => any;
export declare type ValidatorResult = boolean | IValidatorDetail;
export interface IValidatorDetail {
valid: boolean;
message?: string;
}
export interface IEnvRule {
required?: boolean;
validator?: IEnvValidator;
}
export interface IEnvRules {
[key: string]: IEnvRule;
}
export interface IEnv {
[key: string]: string;
}
export interface IValidateInput {
envParsed?: IEnv;
envDefault: IEnv;
envRules?: IEnvRules;
logPassedMsg?: boolean;
}
export default function validate({ envParsed, envDefault, envRules, logPassedMsg }: IValidateInput): void;