Arrays of Validators

Values often need to be validated against multiple validators. This can be represented in Strickland by using arrays of validators with a top-level validator that operates over the array. The top-level validator can invoke the validate function to collect results from each validator and combine the results into a top-level validation result.

Here is a validator that validates every validator in an array, short-circuiting as soon as an invalid result is encountered.

The every validator uses the factory pattern, accepting an array of validators and returning a function to validate every one of the validators. Because validators can accept validation context, those must be accepted and passed through.