Interface ValidateStringOptions

interface ValidateStringOptions {
    enum?: string[];
    match?: RegExp | [RegExp, string] | readonly [RegExp, string];
    maxlength?: number | [number, string] | readonly [number, string];
    minlength?: number | [number, string] | readonly [number, string];
}

Properties

enum?: string[]

Only allow Values from the enum

match?: RegExp | [RegExp, string] | readonly [RegExp, string]

Only allow values that match this RegExp

maxlength?: number | [number, string] | readonly [number, string]

Only allow values that have at max this length

minlength?: number | [number, string] | readonly [number, string]

Only allow values that have at least this length