O3 Framework / validator
validator(
validationFunction,message):Validator
Defined in: packages/framework/esm-config/src/validators/validator.ts:25
Constructs a custom validator.
{
foo: {
_default: 0,
_validators: [
validator(val => val >= 0, "Must not be negative.")
]
}
}
Takes the configured value as input. Returns true if it is valid, false otherwise.
A string message that explains why the value is invalid. Can also be a function that takes the value as input and returns a string.
string |
(value) => string |
A validator ready for use in a config schema