@freelog/tools-lib 0.1.151 → 0.1.153

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.
@@ -5,12 +5,11 @@ 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}(?<!_)$/);
9
- export const RESOURCE_TYPE: RegExp = new RegExp(/^[a-z0-9][a-z0-9_]{1,18}[a-z0-9]$/);
8
+ export const RESOURCE_TYPE: RegExp = new RegExp('^[\u4e00-\u9fefa-zA-Z0-9\\-&.,]{1,40}$');
10
9
 
11
10
  // 自定义属性键
12
- // export const CUSTOM_KEY: RegExp = new RegExp(/^[a-zA-Z0-9_]{1,20}$/);
13
- export const CUSTOM_KEY: RegExp = new RegExp(/^[a-zA-Z_][a-zA-Z0-9_]{1,19}$/);
11
+ // export const CUSTOM_KEY: RegExp = new RegExp(/^[a-zA-Z_]([a-zA-Z0-9_]{1,19})?$/);
12
+ export const CUSTOM_KEY: RegExp = new RegExp('^[a-zA-Z]([a-zA-Z0-9_]{1,19})?$');
14
13
 
15
14
  // 节点名称
16
15
  export const NODE_NAME: RegExp = new RegExp(/^[\u4E00-\u9FA5|a-zA-Z0-9]{2,24}$/);
@@ -44,10 +43,18 @@ export const NATURAL_NUMBER: RegExp = new RegExp(/^[0-9]*$/);
44
43
  export const POSITIVE_INTEGER = new RegExp(/^[1-9]\d*$/);
45
44
 
46
45
  // 最多两位小数的正数
47
- export const MAX_2_DECIMAL_POSITIVE_NUMBER = new RegExp(/^\d+(.\d{1,2})?$/);
46
+ // export const MAX_2_DECIMAL_POSITIVE_NUMBER = new RegExp(/^\d+(.\d{1,2})?$/);
47
+ export const MAX_2_DECIMAL_POSITIVE_NUMBER = new RegExp(/^\d+(\.\d{0,2})?$/);
48
48
 
49
49
  // 对象的Bucket名称
50
50
  export const BUCKET_NAME: RegExp = new RegExp(/^([a-z0-9][a-z0-9-]{0,61})?[a-z0-9]$/);
51
51
 
52
52
  // JS变量名称
53
53
  export const JS_VARIABLE_NAME: RegExp = new RegExp(/^[A-Za-z$_][\w$_]*$/);
54
+
55
+ // 日期
56
+ export const DATE: RegExp = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/);
57
+
58
+ // 日期时间
59
+ export const DATE_TIME: RegExp = new RegExp(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/);
60
+