You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2021. It is now read-only.
validate.single([1,2,3],{type: 'array'});// undefinedvalidate.single('123',{type: 'array'});// ['is not an array']
User should be able to add own or modify existing types:
validate.validators.type.options={notIntegerArray: 'is not an array of integers'};// validate.validators.type.checks contains all types validation rulesvalidate.validators.type.checks.integerArray=function(value){if(!Array.isArray(value)){returnfalse;}for(variinvalue){if(!Number.isInteger(value[i])){returnfalse;}}returntrue;};// ...validate.single([1,2,3],{type: 'integerArray'});// undefinedvalidate.single(['1','2','3'],{type: 'integerArray'});// ['is not an array of integers']