koatty_validation 1.2.7 → 1.2.8

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,13 @@
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.2.8](https://github.com/koatty/koatty_validation/compare/v1.2.7...v1.2.8) (2023-02-17)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * convert type ([924449d](https://github.com/koatty/koatty_validation/commit/924449d9f5fd7b14cbe3c1532f96416e69cc4eed))
11
+
5
12
  ### [1.2.7](https://github.com/koatty/koatty_validation/compare/v1.2.6...v1.2.7) (2023-02-17)
6
13
 
7
14
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2023-02-17 11:33:26
3
+ * @Date: 2023-02-17 14:25:23
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: 2023-02-17 11:33:12
3
+ * @Date: 2023-02-17 14:25:08
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -92,7 +92,8 @@ function plainToClass(clazz, data, convert = false) {
92
92
  function convertDtoParamsType(clazz, cls) {
93
93
  if (Object.prototype.hasOwnProperty.call(cls, "_typeDef")) {
94
94
  for (const key in cls) {
95
- if (Object.prototype.hasOwnProperty.call(cls._typeDef, key)) {
95
+ if (Object.prototype.hasOwnProperty.call(cls._typeDef, key) &&
96
+ cls[key] !== undefined) {
96
97
  cls[key] = convertParamsType(cls[key], cls._typeDef[key]);
97
98
  }
98
99
  }
@@ -100,7 +101,7 @@ function convertDtoParamsType(clazz, cls) {
100
101
  else {
101
102
  const originMap = koatty_container.getOriginMetadata(PARAM_TYPE_KEY, clazz);
102
103
  for (const [key, type] of originMap) {
103
- if (key) {
104
+ if (key && cls[key] !== undefined) {
104
105
  cls[key] = convertParamsType(cls[key], type);
105
106
  }
106
107
  }
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2023-02-17 11:33:12
3
+ * @Date: 2023-02-17 14:25:08
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -68,7 +68,8 @@ function plainToClass(clazz, data, convert = false) {
68
68
  function convertDtoParamsType(clazz, cls) {
69
69
  if (Object.prototype.hasOwnProperty.call(cls, "_typeDef")) {
70
70
  for (const key in cls) {
71
- if (Object.prototype.hasOwnProperty.call(cls._typeDef, key)) {
71
+ if (Object.prototype.hasOwnProperty.call(cls._typeDef, key) &&
72
+ cls[key] !== undefined) {
72
73
  cls[key] = convertParamsType(cls[key], cls._typeDef[key]);
73
74
  }
74
75
  }
@@ -76,7 +77,7 @@ function convertDtoParamsType(clazz, cls) {
76
77
  else {
77
78
  const originMap = getOriginMetadata(PARAM_TYPE_KEY, clazz);
78
79
  for (const [key, type] of originMap) {
79
- if (key) {
80
+ if (key && cls[key] !== undefined) {
80
81
  cls[key] = convertParamsType(cls[key], type);
81
82
  }
82
83
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty_validation",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty_validation",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
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",