From bcecd89861b5cf38e2957e71af60288f229ab1bf Mon Sep 17 00:00:00 2001 From: Joe Krill Date: Wed, 19 Apr 2017 22:06:13 -0400 Subject: [PATCH] fix(docs): correct validateSchema example * Correct `validateSchema` example variable name The function gets a `value` argument but the body was referring to an `age` variable (which wouldn't exist here). It should test the `value` parameter (alternatively, rename the `value` argument to `age`). * Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fba664e..1143583 100644 --- a/README.md +++ b/README.md @@ -175,8 +175,10 @@ compose( required: true }, age: { - test: (value) => { - return age && age > 18 + test: (value, fail) => { + if (!value || value <= 18) { + return fail('Age must be 18 or older'); + } } } })