import { everyTrue } from "https://deno.land/x/is_valid@v1.0.0-beta.16/composite/is_valid.ts";
Iteration of validators that returns true
when everything are true
.
Examples
Example 1
Example 1
const isValidPassword = everyTrue(isString, gtLength(8), ltLength(30))
isValidPassword('this-is-valid-password') // true
Example 2
Example 2
const dangerValidation = everyTrue((val: any) => val.size === 1)
// null.size will occur TypeError but catch and return false
dangerValidation(null) // false