koatty_validation 1.3.0 → 1.3.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.3.2](https://github.com/koatty/koatty_validation/compare/v1.3.1...v1.3.2) (2024-01-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * deps ([6da3e43](https://github.com/koatty/koatty_validation/commit/6da3e437c946c9de2fc45f5319768fef0c4609b0))
11
+
12
+ ### [1.3.1](https://github.com/koatty/koatty_validation/compare/v1.3.0...v1.3.1) (2024-01-07)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * comment ([d898cf6](https://github.com/koatty/koatty_validation/commit/d898cf68bc8693f78155b7208b419dc4b11dffb4))
18
+ * dto赋值类型 ([5a1d68d](https://github.com/koatty/koatty_validation/commit/5a1d68dea0b67e988427c54abae9bfe76a6eaf48))
19
+
5
20
  ## [1.3.0](https://github.com/koatty/koatty_validation/compare/v1.2.10...v1.3.0) (2024-01-03)
6
21
 
7
22
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-01-03 14:41:03
3
+ * @Date: 2024-01-14 21:57:04
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-01-03 14:40:53
3
+ * @Date: 2024-01-14 21:56:49
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -84,7 +84,7 @@ function assignDtoParams(clazz, data, convert = false) {
84
84
  const cls = Reflect.construct(clazz, []);
85
85
  if (convert) {
86
86
  const metaData = getDtoParamsMeta(clazz, cls);
87
- for (const [key, type] of Object.entries(metaData)) {
87
+ for (const [key, type] of metaData) {
88
88
  if (key && data[key] !== undefined) {
89
89
  cls[key] = convertParamsType(data[key], type);
90
90
  }
@@ -107,6 +107,8 @@ function assignDtoParams(clazz, data, convert = false) {
107
107
  * @returns
108
108
  */
109
109
  function getDtoParamsMeta(clazz, cls) {
110
+ // Non-own properties are inherited from the prototype chain,
111
+ // ensure that properties are not polluted
110
112
  if (!Object.prototype.hasOwnProperty.call(cls, "_typeDef") &&
111
113
  ("_typeDef" in cls)) {
112
114
  return cls._typeDef;
@@ -116,7 +118,7 @@ function getDtoParamsMeta(clazz, cls) {
116
118
  enumerable: true,
117
119
  configurable: false,
118
120
  writable: false,
119
- value: typeDef
121
+ value: typeDef,
120
122
  });
121
123
  return typeDef;
122
124
  }
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2024-01-03 14:40:53
3
+ * @Date: 2024-01-14 21:56:49
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -63,7 +63,7 @@ function assignDtoParams(clazz, data, convert = false) {
63
63
  const cls = Reflect.construct(clazz, []);
64
64
  if (convert) {
65
65
  const metaData = getDtoParamsMeta(clazz, cls);
66
- for (const [key, type] of Object.entries(metaData)) {
66
+ for (const [key, type] of metaData) {
67
67
  if (key && data[key] !== undefined) {
68
68
  cls[key] = convertParamsType(data[key], type);
69
69
  }
@@ -86,6 +86,8 @@ function assignDtoParams(clazz, data, convert = false) {
86
86
  * @returns
87
87
  */
88
88
  function getDtoParamsMeta(clazz, cls) {
89
+ // Non-own properties are inherited from the prototype chain,
90
+ // ensure that properties are not polluted
89
91
  if (!Object.prototype.hasOwnProperty.call(cls, "_typeDef") &&
90
92
  ("_typeDef" in cls)) {
91
93
  return cls._typeDef;
@@ -95,7 +97,7 @@ function getDtoParamsMeta(clazz, cls) {
95
97
  enumerable: true,
96
98
  configurable: false,
97
99
  writable: false,
98
- value: typeDef
100
+ value: typeDef,
99
101
  });
100
102
  return typeDef;
101
103
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty_validation",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Validation Util for Koatty and ThinkORM.",
5
5
  "scripts": {
6
6
  "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
@@ -10,10 +10,12 @@
10
10
  "build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
11
11
  "eslint": "eslint --ext .ts,.js ./",
12
12
  "lock": "npm i --package-lock-only",
13
- "prepublishOnly": "npm test && npm run build",
13
+ "prepublishOnly": "npm test && npm run build && git push --follow-tags origin",
14
14
  "prerelease": "npm test && npm run build",
15
- "pub": "git push --follow-tags origin && npm publish",
16
15
  "release": "standard-version",
16
+ "release:pre": "npm run release -- --prerelease",
17
+ "release:major": "npm run release -- --release-as major",
18
+ "release:minor": "npm run release -- --release-as minor",
17
19
  "test": "npm run eslint && jest --passWithNoTests"
18
20
  },
19
21
  "main": "./dist/index.js",
@@ -74,7 +76,7 @@
74
76
  "typescript": "^5.x.x"
75
77
  },
76
78
  "dependencies": {
77
- "class-validator": "^0.14.0",
79
+ "class-validator": "^0.14.1",
78
80
  "koatty_container": "^1.x.x",
79
81
  "koatty_lib": "^1.x.x",
80
82
  "koatty_logger": "^2.x.x"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty_validation",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Validation Util for Koatty and ThinkORM.",
5
5
  "scripts": {
6
6
  "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
@@ -10,10 +10,12 @@
10
10
  "build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
11
11
  "eslint": "eslint --ext .ts,.js ./",
12
12
  "lock": "npm i --package-lock-only",
13
- "prepublishOnly": "npm test && npm run build",
13
+ "prepublishOnly": "npm test && npm run build && git push --follow-tags origin",
14
14
  "prerelease": "npm test && npm run build",
15
- "pub": "git push --follow-tags origin && npm publish",
16
15
  "release": "standard-version",
16
+ "release:pre": "npm run release -- --prerelease",
17
+ "release:major": "npm run release -- --release-as major",
18
+ "release:minor": "npm run release -- --release-as minor",
17
19
  "test": "npm run eslint && jest --passWithNoTests"
18
20
  },
19
21
  "main": "./dist/index.js",
@@ -74,7 +76,7 @@
74
76
  "typescript": "^5.x.x"
75
77
  },
76
78
  "dependencies": {
77
- "class-validator": "^0.14.0",
79
+ "class-validator": "^0.14.1",
78
80
  "koatty_container": "^1.x.x",
79
81
  "koatty_lib": "^1.x.x",
80
82
  "koatty_logger": "^2.x.x"