From 6b074972305ddb481d1296f8900e38ec2e515485 Mon Sep 17 00:00:00 2001 From: Nicco Date: Sat, 28 Sep 2019 19:19:10 +0200 Subject: [PATCH] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 9845837..cb61cb7 100644 --- a/README.md +++ b/README.md @@ -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', + } + ] +} +```