Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ron-liu committed Feb 16, 2014
1 parent bfdbb5b commit 324df21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ v.hasErrors(['a', 'b'], [[v.isString]]) // ==> null
### To validate object
``` javascript
v.hasErrors({name: 'john', age: 27}, {name: v.isString, age: v.isNumber}) // ==> null
* v.hasErrors({name: 'john', age: '27'}, {name: v.isString, age: v.isNumber}) // ==> ['it.age is not number']
v.hasErrors({name: 'john', age: '27'}, {name: v.isString, age: v.isNumber}) // ==> ['it.age is not number']
```
### To validate complex object
Expand Down Expand Up @@ -138,6 +138,7 @@ v.hasErrors(
### To extend, add custom validators
* With auto error message
``` javascript
v.register('isGender',
function(value) {
Expand All @@ -147,7 +148,9 @@ v.register('isGender',
v.hasErrors('male', v.isGender) // ==> null
v.hasErrors('middle', v.isGender) // ==> ['it is invalid']
```
* With error message
``` javascript
v.register('isGender', v.build(
function(value) {
Expand Down

0 comments on commit 324df21

Please sign in to comment.