Built-In Validator: some

Strickland provides a some validator. The some validator operates over an array of validators and it will exit as soon as it encounters a valid result. If any of the validators in the array are valid, then the overall result will be valid.

Parameters

The first parameter to the some 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.

Result Properties

some: The array of validation results produced during validation

The some validator adds a some property to the validation result that provides the detailed validation results of every validator that was validated in the array of validators. The validation result property is named some to match the name of the validator (this is a common pattern in Strickland).