Skip to content

Commit

Permalink
Fix Success value in notEmpty validation example
Browse files Browse the repository at this point in the history
I was reading through the `Validation` documentation and noticed this little typo. I'm correct in assuming that the validators should return their `value` property in a `Success`, not the `field`, right?
  • Loading branch information
scotttrinh authored and robotlolita committed Sep 6, 2017
1 parent 9283a0c commit 461d773
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion annotations/source/en/validation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Neither of those are very compelling. The Validation structure gives you a tool
const { Success, Failure } = Validation;

const notEmpty = (field, value) =>
value.trim() ? Success(field)
value.trim() ? Success(value)
: /* else */ Failure([`${field} can't be empty`]);

const minLength = (field, min, value) =>
Expand Down

0 comments on commit 461d773

Please sign in to comment.