rxtutils 1.1.2-beta.20 → 1.1.2-beta.22

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.
@@ -19,7 +19,8 @@ import { BaseValidator } from './validator.js';
19
19
  * username?: string;
20
20
  * }
21
21
  */
22
- declare function VRequired(noneVals?: any[]): (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
22
+ declare function VRequired(noneVals?: any[]): (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
23
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
23
24
  /**
24
25
  * 字符串类型验证装饰器
25
26
  * 验证值是否为字符串类型
@@ -32,7 +33,8 @@ declare function VRequired(noneVals?: any[]): (message?: ((val: any, value: unde
32
33
  * username?: string;
33
34
  * }
34
35
  */
35
- declare const VString: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
36
+ declare const VString: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
37
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
36
38
  /**
37
39
  * 数字类型验证装饰器
38
40
  * 验证值是否为数字类型
@@ -45,7 +47,8 @@ declare const VString: (message?: ((val: any, value: undefined, context: ClassFi
45
47
  * age?: number;
46
48
  * }
47
49
  */
48
- declare const VNumber: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
50
+ declare const VNumber: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
51
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
49
52
  /**
50
53
  * 数组类型验证装饰器
51
54
  * 验证值是否为数组类型
@@ -58,7 +61,8 @@ declare const VNumber: (message?: ((val: any, value: undefined, context: ClassFi
58
61
  * tags?: string[];
59
62
  * }
60
63
  */
61
- declare const VArray: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
64
+ declare const VArray: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
65
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
62
66
  /**
63
67
  * 布尔类型验证装饰器
64
68
  * 验证值是否为布尔类型
@@ -71,7 +75,8 @@ declare const VArray: (message?: ((val: any, value: undefined, context: ClassFie
71
75
  * active?: boolean;
72
76
  * }
73
77
  */
74
- declare const VBoolean: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
78
+ declare const VBoolean: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
79
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
75
80
  /**
76
81
  * 最小值验证装饰器
77
82
  * 验证数字是否大于或等于指定的最小值
@@ -85,7 +90,8 @@ declare const VBoolean: (message?: ((val: any, value: undefined, context: ClassF
85
90
  * age?: number;
86
91
  * }
87
92
  */
88
- declare const VMin: (min: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
93
+ declare const VMin: (min: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
94
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
89
95
  /**
90
96
  * 最大值验证装饰器
91
97
  * 验证数字是否小于或等于指定的最大值
@@ -99,7 +105,8 @@ declare const VMin: (min: number) => (message?: ((val: any, value: undefined, co
99
105
  * age?: number;
100
106
  * }
101
107
  */
102
- declare const VMax: (max: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
108
+ declare const VMax: (max: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
109
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
103
110
  /**
104
111
  * 最小长度验证装饰器
105
112
  * 验证字符串或数组的长度是否大于或等于指定的最小长度
@@ -113,7 +120,8 @@ declare const VMax: (max: number) => (message?: ((val: any, value: undefined, co
113
120
  * password?: string;
114
121
  * }
115
122
  */
116
- declare const VMinLength: (minLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
123
+ declare const VMinLength: (minLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
124
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
117
125
  /**
118
126
  * 最大长度验证装饰器
119
127
  * 验证字符串或数组的长度是否小于或等于指定的最大长度
@@ -127,7 +135,8 @@ declare const VMinLength: (minLen: number) => (message?: ((val: any, value: unde
127
135
  * username?: string;
128
136
  * }
129
137
  */
130
- declare const VMaxLength: (maxLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
138
+ declare const VMaxLength: (maxLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
139
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
131
140
  /**
132
141
  * 邮箱格式验证装饰器
133
142
  * 验证字符串是否符合邮箱格式
@@ -140,7 +149,8 @@ declare const VMaxLength: (maxLen: number) => (message?: ((val: any, value: unde
140
149
  * email?: string;
141
150
  * }
142
151
  */
143
- declare const VEmail: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
152
+ declare const VEmail: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
153
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
144
154
  /**
145
155
  * 正则表达式验证装饰器
146
156
  * 验证字符串是否匹配指定的正则表达式模式
@@ -154,6 +164,7 @@ declare const VEmail: (message?: ((val: any, value: undefined, context: ClassFie
154
164
  * phone?: string;
155
165
  * }
156
166
  */
157
- declare const VPattern: (pattern: RegExp) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
167
+ declare const VPattern: (pattern: RegExp) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
168
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
158
169
 
159
170
  export { VArray, VBoolean, VEmail, VMax, VMaxLength, VMin, VMinLength, VNumber, VPattern, VRequired, VString };
@@ -58,7 +58,7 @@ var BaseValidator = /** @class */ (function () {
58
58
  * @param order 验证字段的顺序,可以指定验证的字段名数组及其顺序
59
59
  * @returns 验证错误数组,如果没有错误则返回null
60
60
  */
61
- BaseValidator.prototype.validateAll = function (itemAll, everyItem, order) {
61
+ BaseValidator.prototype.validateAll = function (order, itemAll, everyItem) {
62
62
  if (itemAll === void 0) { itemAll = false; }
63
63
  if (everyItem === void 0) { everyItem = false; }
64
64
  var validatorMap = this[this.__keySymbol];
@@ -36,7 +36,7 @@ declare class BaseValidator {
36
36
  * @param itemAll 是否验证所有规则,为true时会验证该字段的所有规则,为false时遇到第一个失败的规则就停止
37
37
  * @returns 验证错误数组,如果没有错误则返回null
38
38
  */
39
- validate(itemKey: string, itemAll?: boolean): Record<string, string[]>;
39
+ validate(itemKey: string, itemAll?: boolean): Record<string, string[]> | null;
40
40
  /**
41
41
  * 验证多个或所有字段
42
42
  * @param itemAll 是否验证每个字段的所有规则,为true时会验证字段的所有规则,为false时遇到第一个失败的规则就停止
@@ -44,7 +44,7 @@ declare class BaseValidator {
44
44
  * @param order 验证字段的顺序,可以指定验证的字段名数组及其顺序
45
45
  * @returns 验证错误数组,如果没有错误则返回null
46
46
  */
47
- validateAll(itemAll?: boolean, everyItem?: boolean, order?: string[]): Record<string, string[]>;
47
+ validateAll(order?: string[], itemAll?: boolean, everyItem?: boolean): Record<string, string[]> | null;
48
48
  /**
49
49
  * 装饰器创建器
50
50
  * 用于创建属性验证装饰器的工厂函数
@@ -19,7 +19,8 @@ import { BaseValidator } from './validator.js';
19
19
  * username?: string;
20
20
  * }
21
21
  */
22
- declare function VRequired(noneVals?: any[]): (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
22
+ declare function VRequired(noneVals?: any[]): (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
23
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
23
24
  /**
24
25
  * 字符串类型验证装饰器
25
26
  * 验证值是否为字符串类型
@@ -32,7 +33,8 @@ declare function VRequired(noneVals?: any[]): (message?: ((val: any, value: unde
32
33
  * username?: string;
33
34
  * }
34
35
  */
35
- declare const VString: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
36
+ declare const VString: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
37
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
36
38
  /**
37
39
  * 数字类型验证装饰器
38
40
  * 验证值是否为数字类型
@@ -45,7 +47,8 @@ declare const VString: (message?: ((val: any, value: undefined, context: ClassFi
45
47
  * age?: number;
46
48
  * }
47
49
  */
48
- declare const VNumber: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
50
+ declare const VNumber: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
51
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
49
52
  /**
50
53
  * 数组类型验证装饰器
51
54
  * 验证值是否为数组类型
@@ -58,7 +61,8 @@ declare const VNumber: (message?: ((val: any, value: undefined, context: ClassFi
58
61
  * tags?: string[];
59
62
  * }
60
63
  */
61
- declare const VArray: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
64
+ declare const VArray: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
65
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
62
66
  /**
63
67
  * 布尔类型验证装饰器
64
68
  * 验证值是否为布尔类型
@@ -71,7 +75,8 @@ declare const VArray: (message?: ((val: any, value: undefined, context: ClassFie
71
75
  * active?: boolean;
72
76
  * }
73
77
  */
74
- declare const VBoolean: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
78
+ declare const VBoolean: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
79
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
75
80
  /**
76
81
  * 最小值验证装饰器
77
82
  * 验证数字是否大于或等于指定的最小值
@@ -85,7 +90,8 @@ declare const VBoolean: (message?: ((val: any, value: undefined, context: ClassF
85
90
  * age?: number;
86
91
  * }
87
92
  */
88
- declare const VMin: (min: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
93
+ declare const VMin: (min: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
94
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
89
95
  /**
90
96
  * 最大值验证装饰器
91
97
  * 验证数字是否小于或等于指定的最大值
@@ -99,7 +105,8 @@ declare const VMin: (min: number) => (message?: ((val: any, value: undefined, co
99
105
  * age?: number;
100
106
  * }
101
107
  */
102
- declare const VMax: (max: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
108
+ declare const VMax: (max: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
109
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
103
110
  /**
104
111
  * 最小长度验证装饰器
105
112
  * 验证字符串或数组的长度是否大于或等于指定的最小长度
@@ -113,7 +120,8 @@ declare const VMax: (max: number) => (message?: ((val: any, value: undefined, co
113
120
  * password?: string;
114
121
  * }
115
122
  */
116
- declare const VMinLength: (minLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
123
+ declare const VMinLength: (minLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
124
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
117
125
  /**
118
126
  * 最大长度验证装饰器
119
127
  * 验证字符串或数组的长度是否小于或等于指定的最大长度
@@ -127,7 +135,8 @@ declare const VMinLength: (minLen: number) => (message?: ((val: any, value: unde
127
135
  * username?: string;
128
136
  * }
129
137
  */
130
- declare const VMaxLength: (maxLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
138
+ declare const VMaxLength: (maxLen: number) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
139
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
131
140
  /**
132
141
  * 邮箱格式验证装饰器
133
142
  * 验证字符串是否符合邮箱格式
@@ -140,7 +149,8 @@ declare const VMaxLength: (maxLen: number) => (message?: ((val: any, value: unde
140
149
  * email?: string;
141
150
  * }
142
151
  */
143
- declare const VEmail: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
152
+ declare const VEmail: (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
153
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
144
154
  /**
145
155
  * 正则表达式验证装饰器
146
156
  * 验证字符串是否匹配指定的正则表达式模式
@@ -154,6 +164,7 @@ declare const VEmail: (message?: ((val: any, value: undefined, context: ClassFie
154
164
  * phone?: string;
155
165
  * }
156
166
  */
157
- declare const VPattern: (pattern: RegExp) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => void;
167
+ declare const VPattern: (pattern: RegExp) => (message?: ((val: any, value: undefined, context: ClassFieldDecoratorContext<BaseValidator>) => string) | string) => (value: undefined, // 简单邮箱正则
168
+ context: ClassFieldDecoratorContext<BaseValidator>) => void;
158
169
 
159
170
  export { VArray, VBoolean, VEmail, VMax, VMaxLength, VMin, VMinLength, VNumber, VPattern, VRequired, VString };
@@ -36,7 +36,7 @@ declare class BaseValidator {
36
36
  * @param itemAll 是否验证所有规则,为true时会验证该字段的所有规则,为false时遇到第一个失败的规则就停止
37
37
  * @returns 验证错误数组,如果没有错误则返回null
38
38
  */
39
- validate(itemKey: string, itemAll?: boolean): Record<string, string[]>;
39
+ validate(itemKey: string, itemAll?: boolean): Record<string, string[]> | null;
40
40
  /**
41
41
  * 验证多个或所有字段
42
42
  * @param itemAll 是否验证每个字段的所有规则,为true时会验证字段的所有规则,为false时遇到第一个失败的规则就停止
@@ -44,7 +44,7 @@ declare class BaseValidator {
44
44
  * @param order 验证字段的顺序,可以指定验证的字段名数组及其顺序
45
45
  * @returns 验证错误数组,如果没有错误则返回null
46
46
  */
47
- validateAll(itemAll?: boolean, everyItem?: boolean, order?: string[]): Record<string, string[]>;
47
+ validateAll(order?: string[], itemAll?: boolean, everyItem?: boolean): Record<string, string[]> | null;
48
48
  /**
49
49
  * 装饰器创建器
50
50
  * 用于创建属性验证装饰器的工厂函数
@@ -56,7 +56,7 @@ var BaseValidator = /** @class */ (function () {
56
56
  * @param order 验证字段的顺序,可以指定验证的字段名数组及其顺序
57
57
  * @returns 验证错误数组,如果没有错误则返回null
58
58
  */
59
- BaseValidator.prototype.validateAll = function (itemAll, everyItem, order) {
59
+ BaseValidator.prototype.validateAll = function (order, itemAll, everyItem) {
60
60
  if (itemAll === void 0) { itemAll = false; }
61
61
  if (everyItem === void 0) { everyItem = false; }
62
62
  var validatorMap = this[this.__keySymbol];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rxtutils",
3
- "version": "1.1.2-beta.20",
3
+ "version": "1.1.2-beta.22",
4
4
  "type": "module",
5
5
  "main": "cjs/index.cjs",
6
6
  "module": "es/index.mjs",