voler-validator-form
v1.0.2
Published
a powerful form validator
Downloads
2
Readme
voler-validator-form
a powerful and simple form data validator.
why use voler-validator-form?
- we used typescript and functional programing,witch made it more stronger and esay use.
- it is flexble , you can use it in Vue , React etc
Installation
yarn add voler-validator-form
Documentation
Examples
const value = {
username:'',
password:'',
email:'',
url:'',
note:''
}
const rule = [
{
key: 'username',
required: true,
minLength: 8,
maxLength: 1,
},
{key: 'password', required: true},
{key: 'email', email: true},
{key: 'url', url: true},
{key: 'note', chinese: true}
];
const infor: { [key: string]: string } = {
required: '唯一',
};
formValidator(value, rule, (e) =>
{console.log(e);}, infor);
License
Forme is MIT licensed.