Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
fix(docs): correct validateSchema example
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
joekrill authored and David Zukowski committed Apr 20, 2017
1 parent 49f36e3 commit bcecd89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
}
})
Expand Down

0 comments on commit bcecd89

Please sign in to comment.