Register a new validator.
Validator to register.
Test a WeakMap to include any of the provided keys. The keys are tested by identity, not structure.
The keys that could be a key in the WeakMap.
Test a WeakMap to include all the provided keys. The keys are tested by identity, not structure.
The keys that should be a key in the WeakMap.
Test if the value matches a custom validation function. The validation function should return true
if the value passes the function. If the function either returns false
or a string, the function fails and the string will be used as error message.
Validation function.
Provide a new error message to be thrown when the validation fails.
Either a string containing the new message or a function returning the new message.
Test if the value matches a custom validation function. The validation function should return an object containing a validator
and message
. If the validator
is false
, the validation fails and the message
will be used as error message. If the message
is a function, the function is invoked with the label
as argument to let you further customize the error message.
Custom validation function.
Invert the following validators.