var Validator = require('Validator')
var data = {
voteNumber: 33
}
var rules = {
voteNumber: 'digits_between:1,10'
}
var v = Validator.make(data, rules)
// should run this place
if (v.fails()) {
var errors = v.getErrors()
console.log(errors)
}
if (v.passes()) {
console.log('pass')
}
also I got error TypeError: itemRules.split is not a function when use an array of strings rule
var data = {
company: 'Example Co.'
}
var rules = {
company: ['required', 'string'] // can be an array of strings
}
var v = Validator.make(data, rules)
if (v.fails()) {
var errors = v.getErrors()
console.log(errors)
}
version 1.0.5
also I got error
TypeError: itemRules.split is not a function
when use an array of strings rule