tools-min-ns 1.9.0 → 1.9.1

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/README.md CHANGED
@@ -5,6 +5,10 @@ cnpm i tools-min-ns --save
5
5
  ```
6
6
 
7
7
  # updates
8
+ ## v1.9.1
9
+
10
+ > CheckUtil getFormItemRules 删除泛型和无用_validator参数
11
+
8
12
  ## v1.9.0
9
13
 
10
14
  > CheckUtil getFormItemRules 新增required参数
@@ -101,11 +101,18 @@ declare namespace CheckUtil {
101
101
  * @param type 类型
102
102
  * @param options
103
103
  */
104
- function getFormItemRules<T>(type: StrType, options?: {
104
+ function getFormItemRules(type: StrType, options?: {
105
105
  label?: string;
106
106
  required?: boolean;
107
107
  errMsg?: string;
108
- _validator?: any;
109
- }): T[];
108
+ }): ({
109
+ required: boolean;
110
+ message: string;
111
+ validator?: undefined;
112
+ } | {
113
+ validator: (_: any, value: string, c: any) => Promise<void>;
114
+ required?: undefined;
115
+ message?: undefined;
116
+ })[];
110
117
  }
111
118
  export default CheckUtil;
@@ -495,9 +495,7 @@ var CheckUtil;
495
495
  }] : []), false), [{
496
496
  validator: function validator(_, value, c) {
497
497
  return __awaiter(_this, void 0, void 0, function () {
498
- var _a;
499
- return __generator(this, function (_b) {
500
- (_a = options === null || options === void 0 ? void 0 : options._validator) === null || _a === void 0 ? void 0 : _a.call(options, _, value, c);
498
+ return __generator(this, function (_a) {
501
499
  if (!value || CheckUtil.checkAny(value, type)) return [2 /*return*/, Promise.resolve()];
502
500
  if (type === 'LOGIN_NAME') {
503
501
  return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "".concat(msg, "\u53EA\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u6216\u51CF\u53F7\uFF1B\u9996\u5B57\u6BCD\u5FC5\u987B\u4E3A\u5B57\u6BCD\uFF1B\u957F\u5EA6\u4E3A6-18\u4E2A\u5B57\u7B26\uFF1B\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26")))];
@@ -101,11 +101,18 @@ declare namespace CheckUtil {
101
101
  * @param type 类型
102
102
  * @param options
103
103
  */
104
- function getFormItemRules<T>(type: StrType, options?: {
104
+ function getFormItemRules(type: StrType, options?: {
105
105
  label?: string;
106
106
  required?: boolean;
107
107
  errMsg?: string;
108
- _validator?: any;
109
- }): T[];
108
+ }): ({
109
+ required: boolean;
110
+ message: string;
111
+ validator?: undefined;
112
+ } | {
113
+ validator: (_: any, value: string, c: any) => Promise<void>;
114
+ required?: undefined;
115
+ message?: undefined;
116
+ })[];
110
117
  }
111
118
  export default CheckUtil;
@@ -505,9 +505,7 @@ var CheckUtil;
505
505
  }] : []), false), [{
506
506
  validator: function validator(_, value, c) {
507
507
  return __awaiter(_this, void 0, void 0, function () {
508
- var _a;
509
- return __generator(this, function (_b) {
510
- (_a = options === null || options === void 0 ? void 0 : options._validator) === null || _a === void 0 ? void 0 : _a.call(options, _, value, c);
508
+ return __generator(this, function (_a) {
511
509
  if (!value || CheckUtil.checkAny(value, type)) return [2 /*return*/, Promise.resolve()];
512
510
  if (type === 'LOGIN_NAME') {
513
511
  return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "".concat(msg, "\u53EA\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u6216\u51CF\u53F7\uFF1B\u9996\u5B57\u6BCD\u5FC5\u987B\u4E3A\u5B57\u6BCD\uFF1B\u957F\u5EA6\u4E3A6-18\u4E2A\u5B57\u7B26\uFF1B\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26")))];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tools-min-ns",
3
3
  "description": "工具包适用于前端以及node",
4
- "version": "1.9.0",
4
+ "version": "1.9.1",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
7
7
  "author": "nanshen",