Update README.md

This commit is contained in:
Nicco 2019-09-28 19:19:10 +02:00 committed by GitHub
parent e3398b8571
commit 6b07497230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,3 +189,21 @@ const validators = {
} }
} }
``` ```
###### Example: Multiple Validators
```javascript
const validators = {
username: [{
validator: /^[A-z]*$/,
message: 'My custom error message',
},
/[\d]/,
async (value) => value.length > 0,
{
validator: (value) => true,
message: 'Some other error',
}
]
}
```