1.0.2 • Published 5 years ago

voler-validator-form v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

voler-validator-form

GitHub license

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


*API Reference

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.

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.2

5 years ago