all
validator. The all
validator operates over an array and it will only return a valid result if all validators in the array are valid. But all
has a significant difference from every
: all
will always execute all validators, regardless of previous results. You can use all
if all validators are safe to execute and you need to know all validator results, even if some are invalid.all
validator factory is the array of validators. Validator props can also be supplied either as an object or as a function that accepts context and returns a validator props object.all
: The array of validation results produced during validationall
validator adds an all
property to the validation result with the validation results of all validators that were validated in the array of validators. The validation result property is named all
to match the name of the validator (this is a common pattern in Strickland).required
validator added the required: true
property to the resultminLength
validator added the minLength: 5
property to the resultmaxLength
validator added the maxLength: 10
property to the resultmessage
from the maxLength
validator replaced the messages provided by the required
and minLength
validatorsall
validatorisValid
prop on the result reflects the overall validation result