A library for data validation.
verification.js
A library for data validation.
Install
Usage
No ES6
var verification = require('verification'); verification.isNumeric('123');
ES6
import verification from 'verification'; verification.isEmail('accord@123.com');
With Browser
<script type="text/javascript" src="./verification.js"></script> <script type="text/javascript"> const result = verification.isURL('http://www.taoyage.net'); </script>
API
verification base dataType
isUndefined isDefined isArray isObject isString isNumber isDate isFunction isRegExp isFile isFormData isBoolean
Required
isRequired
verification string data
isURL isLowervase isUppercase isNumeric isEmail isAscii isIpv4 isIpv6 isIp
verification option data
HomePage
https://github.com/taoyage/verification#readme
Repository
git+https://github.com/taoyage/verification.git
来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/6005606981e8991b448de8d8