Interface StringConfigOptions<K>

StringConfigOptions may be used to constrain the set of legal values a string config value may contain.

interface StringConfigOptions<K> {
    allowedValues?: K[];
    maxLength?: number;
    minLength?: number;
    pattern?: string | RegExp;
}

Type Parameters

  • K extends string = string

Properties

allowedValues?: K[]

The legal enum values. If it does not match, a ConfigEnumError is thrown.

maxLength?: number

The maximum string length. If the string is longer than this, a ConfigRangeError is thrown.

minLength?: number

The minimum string length. If the string is not this long, a ConfigRangeError is thrown.

pattern?: string | RegExp

A regular expression the string must match. If it does not match, a ConfigPatternError is thrown.

Generated using TypeDoc