vtypes-func
"function" validation for validate.js
About
The function
validator attempts to ensure that the field is a valid function.
Installation
Using npm:
$ npm i --save vtypes-func
const validate = ;const vFunc = ; // you can then proceed to register the required validators.validatevalidatorsfunc = vFunc;
Usage
;// => undefined ;// => {attr: ["Attr must be of type function"]}
For more examples, check out the test files in this package's source folder.
Available Options
name | type | default | description |
---|---|---|---|
message | string | must be of type function |
Error message |
License
vtypes-func
is MIT licensed