ztxkutils 10.0.0 → 10.0.2

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.
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @description 常用正则表达式
3
+ */
4
+ var validate = {
5
+ /**
6
+ * @description 长度验证,最小长度字符,0-200个字符
7
+ */
8
+ smallLenValidate: /^(?:\s*)[\s\S]{0,200}(?:\s*)$/,
9
+ /**
10
+ * @description 长度验证,中等长度字符,0-400个字符
11
+ */
12
+ middleLenValidate: /^(?:\s*)[\s\S]{0,400}(?:\s*)$/,
13
+ /**
14
+ * @description 长度验证,最大长度字符,0-600个字符
15
+ */
16
+ largeLenValidate: /^(?:\s*)[\s\S]{0,600}(?:\s*)$/,
17
+ /**
18
+ * @description 长度验证,最大长度字符,0-5000个字符
19
+ */
20
+ maxlargeLenValidate: /^(?:\s*)[\s\S]{0,5000}(?:\s*)$/,
21
+ /**
22
+ * @description 电话号码验证
23
+ */
24
+ // phoneValidate: /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/,
25
+ // 数字 横线 长度 0 - 15位/^([0-9])|(\-)*$/
26
+ phoneValidate: /^[0-9\-]{0,15}$/,
27
+ /**
28
+ * @description 短信验证码 接受11位手机号
29
+ */
30
+ shortPhoneValidate: /^1[0-9]{10}$/,
31
+ /**
32
+ * @description 身份证验证
33
+ * 18位 最后一位可以是X x
34
+ */
35
+ idCardValidate: /^[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]$/,
36
+ /**
37
+ * @description 邮箱验证
38
+ */
39
+ emailValidate: /^([\s\S])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/,
40
+ /**
41
+ * @description 密码验证
42
+ */
43
+ passwordValidate: /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$)^.{8,16}$/,
44
+ /**
45
+ * @description 空格验证
46
+ */
47
+ spaceValidate: /^[^\s]*$/g,
48
+ };
49
+ var commonMessage = {
50
+ smallLenMessage: function (type) {
51
+ if (type === void 0) { type = ''; }
52
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6200";
53
+ },
54
+ middleLenMessage: function (type) {
55
+ if (type === void 0) { type = ''; }
56
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6400";
57
+ },
58
+ largeLenMessage: function (type) {
59
+ if (type === void 0) { type = ''; }
60
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6600";
61
+ },
62
+ maxlargeLenValidate: function (type) {
63
+ if (type === void 0) { type = ''; }
64
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA65000";
65
+ },
66
+ phoneMessage: '请输入正确的手机号',
67
+ idCardMessage: '请输入正确的身份证',
68
+ emailMessage: '请输入正确的邮箱',
69
+ passwordMessage: '密码由8-16位的字母+数字,字母+特殊字符,数字+特殊字符组成',
70
+ spaceMessage: '请勿输入空格',
71
+ };
72
+
73
+ var validate$1 = /*#__PURE__*/Object.freeze({
74
+ __proto__: null,
75
+ validate: validate,
76
+ commonMessage: commonMessage
77
+ });
78
+
79
+ export { validate as a, commonMessage as c, validate$1 as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "10.0.0",
3
+ "version": "10.0.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -72,4 +72,4 @@
72
72
  "zt-sockjs-client": ">=0.0.1",
73
73
  "zt-stompjs": ">=1.0.3"
74
74
  }
75
- }
75
+ }