@hzab/utils 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # @hzab/utils@1.0.12
2
+
3
+ feat: 去除省市区行政校验
4
+
1
5
  # @hzab/utils@1.0.11
2
6
 
3
7
  feat: 身份证校验合法性
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/utils",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "utils",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ export function isValidIdCard(idCard, opt?) {
32
32
  }
33
33
 
34
34
  // 校验地址码(省级+市级)
35
- if (!isValidAddressCode(id18)) return false;
35
+ // if (!isValidAddressCode(id18)) return false;
36
36
 
37
37
  // 校验出生日期是否在合理范围内(1900年-当前年份)
38
38
  if (opt?.validBirthDate && !isValidBirthDate(id18)) return false;
@@ -45,20 +45,20 @@ export function isValidIdCard(idCard, opt?) {
45
45
  * 校验地址码(前6位)
46
46
  * 规则校验:省级代码合法 + 市级代码格式合法
47
47
  */
48
- export function isValidAddressCode(id18) {
49
- const addrCode = id18.substring(0, 6);
48
+ // export function isValidAddressCode(id18) {
49
+ // const addrCode = id18.substring(0, 6);
50
50
 
51
- const provinceCode = addrCode.substring(0, 2);
52
- const cityCode = addrCode.substring(2, 4);
51
+ // const provinceCode = addrCode.substring(0, 2);
52
+ // const cityCode = addrCode.substring(2, 4);
53
53
 
54
- // 1. 校验省级代码(第1-2位)
55
- if (!isValidProvinceCode(provinceCode)) return false;
54
+ // // 1. 校验省级代码(第1-2位)
55
+ // if (!isValidProvinceCode(provinceCode)) return false;
56
56
 
57
- // 2. 校验市级代码(第3-4位)
58
- if (!isValidCityCode(cityCode)) return false;
57
+ // // 2. 校验市级代码(第3-4位)
58
+ // if (!isValidCityCode(cityCode)) return false;
59
59
 
60
- return true;
61
- }
60
+ // return true;
61
+ // }
62
62
 
63
63
  /**
64
64
  * 校验省级代码(第1-2位)