Comparing version 1.1.1 to 1.1.2
@@ -55,3 +55,4 @@ /***************************************************************** | ||
chinese: /^[\u0391-\uFFE5]+$/, | ||
percent: /^(?:[1-9][0-9]?|100)(?:\.[0-9]{1,2})?$/ | ||
percent: /^(?:[1-9][0-9]?|100)(?:\.[0-9]{1,2})?$/, | ||
idcard: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ | ||
}; | ||
@@ -109,2 +110,6 @@ | ||
return regexs.percent.test(backVal(field)); | ||
}; | ||
var is_idcard = function is_idcard(field) { | ||
return regexs.idcard.test(backVal(field)); | ||
}; //test的时候使用commonjs规范,module.exports = { ... } | ||
@@ -116,2 +121,4 @@ | ||
is_empty: is_empty, | ||
// 验证身份证 | ||
is_idcard: is_idcard, | ||
// 验证邮箱 | ||
@@ -118,0 +125,0 @@ is_email: is_email, |
@@ -62,3 +62,4 @@ "use strict"; | ||
chinese: /^[\u0391-\uFFE5]+$/, | ||
percent: /^(?:[1-9][0-9]?|100)(?:\.[0-9]{1,2})?$/ | ||
percent: /^(?:[1-9][0-9]?|100)(?:\.[0-9]{1,2})?$/, | ||
idcard: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ | ||
}; | ||
@@ -116,2 +117,6 @@ | ||
return regexs.percent.test(backVal(field)); | ||
}; | ||
var is_idcard = function is_idcard(field) { | ||
return regexs.idcard.test(backVal(field)); | ||
}; //test的时候使用commonjs规范,module.exports = { ... } | ||
@@ -123,2 +128,4 @@ | ||
is_empty: is_empty, | ||
// 验证身份证 | ||
is_idcard: is_idcard, | ||
// 验证邮箱 | ||
@@ -125,0 +132,0 @@ is_email: is_email, |
{ | ||
"name": "qcfv", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "form validator", | ||
@@ -5,0 +5,0 @@ "main": "./es/index.js", |
@@ -52,2 +52,3 @@ /***************************************************************** | ||
percent: /^(?:[1-9][0-9]?|100)(?:\.[0-9]{1,2})?$/, | ||
idcard:/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ | ||
} | ||
@@ -77,8 +78,11 @@ | ||
const is_percent = function (field) {return regexs.percent.test(backVal(field));} | ||
const is_idcard = function (field) {return regexs.idcard.test(backVal(field));} | ||
//test的时候使用commonjs规范,module.exports = { ... } | ||
export default { | ||
export default { | ||
// 验证字符串是否为空 | ||
is_empty:is_empty , | ||
// 验证身份证 | ||
is_idcard:is_idcard, | ||
// 验证邮箱 | ||
@@ -85,0 +89,0 @@ is_email:is_email, |
@@ -12,3 +12,6 @@ //验证的时候注意改为commonjs规范 | ||
let id = "41018219"; | ||
console.log("idcard",qcfv.is_idcard(id)); | ||
//... |
Sorry, the diff of this file is not supported yet
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
13825
355