UNPKG

container.ts

Version:
19 lines (18 loc) 708 B
import validator from "validator"; import { Field } from "../field"; /** Validate.isString options. */ export interface IIsString extends validator.IsLengthOptions { /** Require lower case characters. */ lowercase?: boolean; /** Require upper case characters. */ uppercase?: boolean; /** Optional array of allowed values. */ values?: string[]; } /** Wrapper for validator methods isLength, isUppercase, isLowercase and isIn. */ export declare function isString(value?: string, options?: IIsString): string; export declare class StringField extends Field<string> { protected readonly options: IIsString; constructor(options?: IIsString); validate(value: string): string; }