Creates an option validator based on a set of option definitions.
The option definitions
The validator configuration
Readonly
connectives: Required<Readonly<Partial<Record<ConnectiveWord, string>>>>The connective words.
Readonly
phrases: Required<Readonly<Partial<Record<ErrorItem, string>>>>The message phrases.
Readonly
styles: Required<MessageStyles>The message styles.
Readonly
configThe validator configuration
Readonly
connectives: Required<Readonly<Partial<Record<ConnectiveWord, string>>>>The connective words.
Readonly
phrases: Required<Readonly<Partial<Record<ErrorItem, string>>>>The message phrases.
Readonly
styles: Required<MessageStyles>The message styles.
Readonly
lettersReadonly
namesReadonly
optionsThe option definitions
Readonly
positionalCreates an error with a formatted message.
The kind of error message
Optional
args: FormatArgsThe message arguments
Optional
flags: FormattingFlagsThe formatting flags
The formatted error
Creates a formatted message.
The kind of error or warning
Optional
args: FormatArgsThe message arguments
Optional
flags: FormattingFlagsThe formatting flags
The formatted message
Normalizes the value of an option and checks its validity against any constraint.
The option definition
The option name (as specified on the command-line)
The option value
The normalized value
On value not satisfying the specified enums, regex or range constraints
Validates all options' definitions, including command options recursively.
The validation flags
The validation result
Implements a compilation of option definitions.