mikeerickson / validatorjs

A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
https://www.npmjs.com/package/validatorjs
MIT License
1.77k stars 280 forks source link

Before assigning to validatorjs we need to convert first all object value to string #142

Closed apmeena closed 7 years ago

apmeena commented 7 years ago

@skaterdav85 i have a JavaScript object

var data  = {
   name:"John",
   emp_id:1223
} 

if i want to put some validation on emp_id field then first i need to convert it to string like "1223" or '1223', if i don't convert it generates error. Is there any configuration setting or it is mandatory or i am doing some mistake?

garygreen commented 7 years ago

The type of value is pretty important in how validatorjs knows how to validate a value. It's not clear what sort of rules your trying to validate, closing for now.