creality-validator
v1.0.1
Published
创想云通用正则表达式
Downloads
3
Keywords
Readme
cre-validator 校验输入函数集
Install
npm i cre-validator
# or
yarn add cre-validator
Usage
import {
hasSpecialChars,
isNormalEmail,
validateEmail,
validateMobile,
validatePassword,
validateNumber
} from 'cre-validator'
/**
* 校验输入是否含特殊字符
* @param {String} input 输入内容
* @return {Boolean}
*/
hasSpecialChars(input)
/**
* 校验邮箱是否含特殊字符
* @param {String} email 邮箱
* @return {Boolean}
*/
isNormalEmail(email)
/**
* 校验邮箱
* @param {String} email 邮箱
* @return {Boolean}
*/
validateEmail(email)
/**
* 校验手机号
* @param {String} mobile 手机号
* @return {Boolean}
*/
validateMobile(mobile)
/**
* 校验密码格式
* @param {String} password 密码
* @return {Boolean}
*/
validatePassword(password)
/**
* 是否全是数字
* @param {String} numStr 数字字符串
* @return {Boolean}
*/
validateNumber(numStr)