Verify that a value matches the rules.
###Install
$ npm install value-validate --save
# or
$ yarn add value-validate
###Usage
import { validation } from 'value-validate';
/**
*
* @param {String} value String that need to be validated
* @param {Object|String} rules Validation rules
*/
validation(
'cedcn@qq.com',
['required', { type: 'email', msg: 'Please input the correct email format!'}],
result => console.log(result);
);
####Rules
required
email
phone
number
number-gt-#{number}
�number-lt-#{number}
�number-gts-#{number}
number-lts-#{number}
count-gts-#{value}
count-lts-#{value}
####Callback
retrun { isPass: [Bool], mag: [String] }