Methods
end()
- Source:
打印结束点
isAccountNumber(value) → {Boolean}
- Source:
验证银行卡号(10到30位, 覆盖对公/私账户, 参考微信支付)
Example
isAccountNumber("6222600260001072444") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isCapital(value) → {Boolean}
- Source:
验证大写英文字母
Example
isCapital("DG") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isChineseCharacter(value) → {Boolean}
- Source:
验证中文/汉字
Example
isChineseCharacter("哈哈") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isChineseName(value) → {Boolean}
- Source:
验证中文姓名
Example
isChineseName("阿泽") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isCHNAndEN(value) → {Boolean}
- Source:
验证中文和数字
Example
isCHNAndEN("啊实打实213") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isColor16(value) → {Boolean}
- Source:
验证16进制颜色
Example
isColor16("#FFB6C1") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isCreditCode(value) → {Boolean}
- Source:
验证统一社会信用代码
Example
isCreditCode("18位") // false
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isDecimal(value) → {Boolean}
- Source:
验证小数
Example
isDecimal("45.55") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isEmail(value) → {Boolean}
- Source:
验证email(邮箱)
Example
isEmail("1638153584@qq.com") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isEnglish(value) → {Boolean}
- Source:
验证英文字母
Example
isEnglish("sadasEFRS") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isEnglishName(value) → {Boolean}
- Source:
验证英文姓名
Example
isEnglishName("zeze") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isHttpAndPort(value) → {Boolean}
- Source:
验证必须带端口号的网址(或ip)
Example
isHttpAndPort("http://192.168.2.153:8080") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isIDCard(value) → {Boolean}
- Source:
验证身份证号, 支持1/2代(15位/18位数字)
Example
isIDCard ("445281199114567539") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isImageUrl(value) → {Boolean}
- Source:
验证图片链接地址(图片格式可按需增删)
Example
isImageUrl("https://imeidb.oss-cn-hangzhou.aliyuncs.com/static/img/imei-4.jpg") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isIMEI(value) → {Boolean}
- Source:
验证手机机身码(IMEI) 手机本身的唯一标识
Example
isIMEI("1591554223239155") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isLandlineTelephone(value) → {Boolean}
- Source:
验证座机电话(国内),如: 0341-86091234
Example
isLandlineTelephone("0754-87398773") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isLicensePlateNumber(value) → {Boolean}
- Source:
验证车牌号
Example
isLicensePlateNumber("川A123AB") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isLicensePlateNumberNER(value) → {Boolean}
- Source:
验证车牌号(新能源)
Example
isLicensePlateNumberNER("京AF01234") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isLicensePlateNumberNNER(value) → {Boolean}
- Source:
验证车牌号(非新能源)
Example
isLicensePlateNumberNNER("川A123AB") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isLowercase(value) → {Boolean}
- Source:
验证小写英文字母
Example
isLowercase("sdf") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isMPRelaxed(value) → {Boolean}
- Source:
验证手机号中国(宽松), 只要是13,14,15,16,17,18,19开头即可
Example
isMPRelaxed("15915549155") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isMPStrict(value) → {Boolean}
- Source:
验证手机号中国(严谨), 根据工信部2019年最新公布的手机号段
Example
isMPStrict("15915549155") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isNoWord(value) → {Boolean}
- Source:
验证不能包含字母
Example
isNoWord("3436") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isNumAndStr(value) → {Boolean}
- Source:
验证数字和字母组成
Example
isNumAndStr("115dsa234") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isNumber(value) → {Boolean}
- Source:
验证数字
Example
isNumber("44455") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isPassport(value) → {Boolean}
- Source:
验证护照(包含香港、澳门)
Example
isPassport("验证护照(包含香港、澳门)") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isPostcode(value) → {Boolean}
- Source:
验证邮政编码(中国)
Example
isPostcode("515071") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isQQNum(value) → {Boolean}
- Source:
验证qq号格式 4-10
Example
isQQNum("16544848") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isRightWebsite(value) → {Boolean}
- Source:
验证网址(支持端口和"?+参数"和"#+参数)
Example
isRightWebsite("http://192.168.2.153:8080?id=5") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isTrainNum(value) → {Boolean}
- Source:
验证火车车次
Example
isTrainNum("K9998") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isVideoUrl(value) → {Boolean}
- Source:
验证视频链接地址(视频格式可按需增删)
Example
isVideoUrl("https://www.bilibili.com/video/av71664605.mp4") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isWebAccount(value) → {Boolean}
- Source:
验证帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线组合
Example
isWebAccount("a123456") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
isWeChatNum(value) → {Boolean}
- Source:
验证微信号,6至20位,以字母开头,字母,数字,减号,下划线
Example
isWeChatNum("dignity_") // true
Parameters:
Name | Type | Description |
---|---|---|
value |
String | 值 |
Returns:
- Type
- Boolean
luhnCheck(num) → {Boolean}
- Source:
银行卡号码校验(luhn算法)
Example
luhnCheck("4485275742308327") // true
luhnCheck("6011329933655299") // false
Parameters:
Name | Type | Description |
---|---|---|
num |
Number | 银行卡号码 |
Returns:
- Type
- Boolean
start()
- Source:
打印开始点