vtypes-string
"string" validation for validate.js
About
The string
validator attempts to ensure that the field is a valid string.
Installation
Using npm:
$ npm i --save vtypes-string
const validate = ;const string = ; // you can then proceed to register the required validators.validatevalidatorsstring = string;
Usage
;// => undefined ;// => {attr: ["Attr must be of type string"]}
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 string |
Error message |
License
vtypes-string
is MIT licensed