verify-check
v1.0.0
Published
verify js
Downloads
7
Readme
verify-check
npm---verify-check
install
npm install verify-check
import
import 'verify-check/dist/verify-check.css'
import 'verify-check/dist/verify-check.js'
unpkg---verify-check
link
<link rel="stylesheet" href="https://unpkg.com/verify-check/dist/verify-check.css"/>
<script src="https://unpkg.com/verify-check/dist/verify-check.js"></script>
example
//对象验证
new VerifyCheck({
email: '[email protected]',
phone: 180
}).check().result
/**
*
* result ==>
* pass 是否通过
* type 错误原因 passed:通过 empty:不能为空 email:邮箱地址不合法 phone:手机号不合法
* result <==
* {
* email: {
* pass: true,
* type: 'passed'
* },
* phone: {
* pass: false,
* type: 'phone'
* }
* }
*
*/
//为空验证
new VerifyCheck().isEmpty(180)
/**
*返回 true 或者 false
*/