javascript - How to validate type with validate.js -


what validate type of object attributes

for example

var correctobject = {     name : "john",     age : 25 };  var constraints = {     ... };  validate(testobject, constraints); //undefined test passes  var incorrectobject = {     name : "john",     age : "25" };  validate(incorrectobject, constraints); // age must string 


Comments