Validator
Validator represents a named validator with an optional map-based configuration object.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Validator(
name):Validator
Constructor returns a named Validator instance.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Validator
Properties
Section titled “Properties”config
Section titled “config”config:
Record<string,unknown> ={}
name:
string
Methods
Section titled “Methods”configValue()
Section titled “configValue()”configValue(
name): [unknown,boolean]
ConfigValue retrieves the value associated with the config key name, if one exists.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”[unknown, boolean]
setConfig()
Section titled “setConfig()”setConfig(
config):this
SetConfig sets the set of map key-value pairs associated with this validator’s configuration.
Parameters
Section titled “Parameters”config
Section titled “config”Record<string, unknown>
Returns
Section titled “Returns”this
validate()
Section titled “validate()”validate():
Error|undefined
Validate validates the configuration of the validator object.
Returns
Section titled “Returns”Error | undefined