@freelog/tools-lib 0.1.59 → 0.1.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freelog/tools-lib",
3
- "version": "0.1.59",
3
+ "version": "0.1.60",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -5,7 +5,8 @@ export const EXHIBIT_NAME: RegExp = new RegExp(/^(?!.*(\\|\/|:|\*|\?|"|<|>|\||\s
5
5
  export const RESOURCE_NAME: RegExp = new RegExp(/^(?!.*(\\|\/|:|\*|\?|"|<|>|\||\s|@|\$|#)).{1,60}$/);
6
6
 
7
7
  // 资源类型
8
- export const RESOURCE_TYPE: RegExp = new RegExp(/^(?!_)[a-z0-9_]{3,20}(?<!_)$/);
8
+ // export const RESOURCE_TYPE: RegExp = new RegExp(/^(?!_)[a-z0-9_]{3,20}(?<!_)$/);
9
+ export const RESOURCE_TYPE: RegExp = new RegExp(/^[a-z0-9][a-z0-9_]{1,18}[a-z0-9]$/);
9
10
 
10
11
  // 自定义属性键
11
12
  export const CUSTOM_KEY: RegExp = new RegExp(/^[a-zA-Z0-9_]{1,20}$/);
@@ -14,7 +15,8 @@ export const CUSTOM_KEY: RegExp = new RegExp(/^[a-zA-Z0-9_]{1,20}$/);
14
15
  export const NODE_NAME: RegExp = new RegExp(/^[\u4E00-\u9FA5|a-zA-Z0-9]{2,24}$/);
15
16
 
16
17
  // 节点地址
17
- export const NODE_DOMAIN: RegExp = new RegExp(/^(?!-)[a-z0-9-]{4,24}(?<!-)$/);
18
+ // export const NODE_DOMAIN: RegExp = new RegExp(/^(?!-)[a-z0-9-]{4,24}(?<!-)$/);
19
+ export const NODE_DOMAIN: RegExp = new RegExp(/^[a-z0-9][a-z0-9-]{2,22}[a-z0-9]$/);
18
20
 
19
21
  // 支付密码
20
22
  export const PAY_PASSWORD: RegExp = new RegExp(/^\d{6}$/);
@@ -27,8 +29,8 @@ export const MOBILE_PHONE_NUMBER = new RegExp(/^1[345789]\d{9}$/);
27
29
  export const EMAIL_ADDRESS: RegExp = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/);
28
30
 
29
31
  // 用户名
30
- // export const USERNAME = /^(?!-)[A-Za-z0-9-]{1,30}(?<!-)$/;
31
- export const USERNAME: RegExp = new RegExp(/^(?!-)[A-Za-z0-9-]{1,30}(?<!-)$/);
32
+ // export const USERNAME: RegExp = new RegExp(/^(?!-)[A-Za-z0-9-]{1,30}(?<!-)$/);
33
+ export const USERNAME: RegExp = new RegExp(/^([A-Za-z0-9][A-Za-z0-9-]{0,28})?[A-Za-z0-9]$/);
32
34
 
33
35
  // 用户密码
34
36
  // export const PASSWORD = /^(?=.*[a-zA-Z])(?=.*[0-9]).{6,24}$/;