allvalidator operates over an array and it will only return a valid result if all validators in the array are valid. But
allhas a significant difference from
allwill always execute all validators, regardless of previous results. You can use
allif all validators are safe to execute and you need to know all validator results, even if some are invalid.
allvalidator 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 validation
allvalidator adds an
allproperty 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
allto match the name of the validator (this is a common pattern in Strickland).
requiredvalidator added the
required: trueproperty to the result
minLengthvalidator added the
minLength: 5property to the result
maxLengthvalidator added the
maxLength: 10property to the result
maxLengthvalidator replaced the messages provided by the
isValidprop on the result reflects the overall validation result