Checks if all the assertions pass.
If you have two or three assertions consider using and2 or and3 respectively.
const userEmail = and([string, minLength(5), maxLength(35), email]);userEmail(1); // Error: typeuserEmail("a"); // Error: minLengthuserEmail("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@test.com"); // Error: maxLengthuserEmail("Hello world"); // Error: emailuserEmail("yamiteru@icloud.com"); // passes Copy
const userEmail = and([string, minLength(5), maxLength(35), email]);userEmail(1); // Error: typeuserEmail("a"); // Error: minLengthuserEmail("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@test.com"); // Error: maxLengthuserEmail("Hello world"); // Error: emailuserEmail("yamiteru@icloud.com"); // passes
Array of assertions to be checked.
Checks if all the assertions pass.
If you have two or three assertions consider using and2 or and3 respectively.
Example