@midwayjs/validate 3.4.3 → 3.4.6

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/dist/service.d.ts CHANGED
@@ -20,4 +20,5 @@ export declare class ValidateService {
20
20
  }): Joi.ValidationResult<T>;
21
21
  getSchema<T extends new (...args: any[]) => any>(ClzType: T): ObjectSchema<any>;
22
22
  }
23
+ export declare function getSchema<T extends new (...args: any[]) => any>(ClzType: T): ObjectSchema<any>;
23
24
  //# sourceMappingURL=service.d.ts.map
package/dist/service.js CHANGED
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ValidateService = void 0;
12
+ exports.getSchema = exports.ValidateService = void 0;
13
13
  const decorator_1 = require("@midwayjs/decorator");
14
14
  const DefaultConfig = require("./config/config.default");
15
15
  const constants_1 = require("./constants");
@@ -65,10 +65,7 @@ let ValidateService = class ValidateService {
65
65
  }
66
66
  }
67
67
  getSchema(ClzType) {
68
- const rules = (0, decorator_1.getClassExtendedMetadata)(constants_1.RULES_KEY, ClzType);
69
- if (rules) {
70
- return Joi.object(rules);
71
- }
68
+ return getSchema(ClzType);
72
69
  }
73
70
  };
74
71
  __decorate([
@@ -94,4 +91,11 @@ ValidateService = __decorate([
94
91
  (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
95
92
  ], ValidateService);
96
93
  exports.ValidateService = ValidateService;
94
+ function getSchema(ClzType) {
95
+ const rules = (0, decorator_1.getClassExtendedMetadata)(constants_1.RULES_KEY, ClzType);
96
+ if (rules) {
97
+ return Joi.object(rules);
98
+ }
99
+ }
100
+ exports.getSchema = getSchema;
97
101
  //# sourceMappingURL=service.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/validate",
3
- "version": "3.4.3",
3
+ "version": "3.4.6",
4
4
  "description": "Midway Component for mongoose",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -23,15 +23,15 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "@midwayjs/i18n": "^3.4.3",
26
+ "@midwayjs/i18n": "^3.4.6",
27
27
  "joi": "^17.2.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@midwayjs/core": "^3.4.3",
31
- "@midwayjs/decorator": "^3.4.1",
32
- "@midwayjs/express": "^3.4.3",
33
- "@midwayjs/koa": "^3.4.3",
34
- "@midwayjs/mock": "^3.4.3"
30
+ "@midwayjs/core": "^3.4.6",
31
+ "@midwayjs/decorator": "^3.4.4",
32
+ "@midwayjs/express": "^3.4.6",
33
+ "@midwayjs/koa": "^3.4.6",
34
+ "@midwayjs/mock": "^3.4.6"
35
35
  },
36
- "gitHead": "0d79293f56d01a3ef3589e6a6ef53c582ac0c46f"
36
+ "gitHead": "36687482782bcf526efc2a4773c09e166820c1a8"
37
37
  }