Comparing version 0.8.77 to 0.8.78
@@ -16,3 +16,3 @@ 'use strict'; | ||
if (!str) return false; | ||
if (/^0?1[2|3|4|5|6|7|8][0-9]\d{8}$/.test(str)) { | ||
if (/^(1[2-9][0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89]|98[0-9]|99[0-9])\d{8}$/.test(str)) { | ||
return true; | ||
@@ -24,2 +24,38 @@ } | ||
/** | ||
* @desc: 判断是否是email. | ||
* @return: boolean. | ||
*/ | ||
exports.isEmail = function (str) { | ||
if (!str) return false; | ||
if (/^(([A-Za-z0-9\u4e00-\u9fa5_-]|\.)+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+)$/.test(str)) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
/** | ||
* @desc: 判断是否是英文数字组合. | ||
* @return: boolean. | ||
*/ | ||
exports.isAlphaOrDigit = function (str) { | ||
if (!str) return false; | ||
if (/^[A-Za-z0-9]+$/.test(str)) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
/** | ||
* @desc: 判断是否是中文. | ||
* @return: boolean. | ||
*/ | ||
exports.isChinese = function (str) { | ||
if (!str) return false; | ||
if (/^[\u4e00-\u9fa5]{0,}$/.test(str)) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
/** | ||
* @desc: 是否为空串. | ||
@@ -26,0 +62,0 @@ * @return: boolean. |
@@ -80,3 +80,3 @@ { | ||
"name": "febs-browser", | ||
"version": "0.8.77" | ||
"version": "0.8.78" | ||
} |
@@ -641,3 +641,3 @@ | ||
*/ | ||
function denodeify(fn: any, self: any, argumentCount?: number): Promise<any>; | ||
function denodeify(fn: any, self?: any, argumentCount?: number): ()=>Promise<any>; | ||
@@ -708,3 +708,22 @@ /** | ||
function isPhoneMobile(str: string): boolean; | ||
/** | ||
* @desc: 判断是否是email. | ||
* @return: boolean. | ||
*/ | ||
function isEmail(str: string): boolean; | ||
/** | ||
* @desc: 判断是否是英文数字组合. | ||
* @return: boolean. | ||
*/ | ||
function isAlphaOrDigit(str: string): boolean; | ||
/** | ||
* @desc: 判断是否是中文. | ||
* @return: boolean. | ||
*/ | ||
function isChinese(str: string): boolean; | ||
/** | ||
* @desc: 是否为空串. | ||
@@ -711,0 +730,0 @@ * @return: boolean. |
@@ -90,3 +90,3 @@ { | ||
"name": "febs", | ||
"version": "0.8.77" | ||
"version": "0.8.78" | ||
} |
@@ -653,3 +653,3 @@ // Type definitions for febs | ||
*/ | ||
function denodeify(fn: any, self: any, argumentCount?: number): Promise<any>; | ||
function denodeify(fn: any, self?: any, argumentCount?: number): ()=>Promise<any>; | ||
@@ -728,3 +728,22 @@ /** | ||
function isPhoneMobile(str: string): boolean; | ||
/** | ||
* @desc: 判断是否是email. | ||
* @return: boolean. | ||
*/ | ||
function isEmail(str: string): boolean; | ||
/** | ||
* @desc: 判断是否是英文数字组合. | ||
* @return: boolean. | ||
*/ | ||
function isAlphaOrDigit(str: string): boolean; | ||
/** | ||
* @desc: 判断是否是中文. | ||
* @return: boolean. | ||
*/ | ||
function isChinese(str: string): boolean; | ||
/** | ||
* @desc: 是否为空串. | ||
@@ -731,0 +750,0 @@ * @return: boolean. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10720835
127
111558