Skip to content

Validator

Validator represents a named validator with an optional map-based configuration object.

new Validator(name): Validator

Constructor returns a named Validator instance.

string

Validator

config: Record<string, unknown> = {}


name: string

configValue(name): [unknown, boolean]

ConfigValue retrieves the value associated with the config key name, if one exists.

string

[unknown, boolean]


setConfig(config): this

SetConfig sets the set of map key-value pairs associated with this validator’s configuration.

Record<string, unknown>

this


validate(): Error | undefined

Validate validates the configuration of the validator object.

Error | undefined