@nestjs/common 9.3.4 → 9.3.5
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/package.json +1 -1
- package/pipes/validation.pipe.js +4 -1
package/package.json
CHANGED
package/pipes/validation.pipe.js
CHANGED
|
@@ -83,7 +83,10 @@ let ValidationPipe = class ValidationPipe {
|
|
|
83
83
|
// if the value was originally undefined or null, revert it back
|
|
84
84
|
return originalValue;
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
// we check if the number of keys of the "validatorOptions" is higher than 1 (instead of 0)
|
|
87
|
+
// because the "forbidUnknownValues" now fallbacks to "false" (in case it wasn't explicitly specified)
|
|
88
|
+
const shouldTransformToPlain = Object.keys(this.validatorOptions).length > 1;
|
|
89
|
+
return shouldTransformToPlain
|
|
87
90
|
? classTransformer.classToPlain(entity, this.transformOptions)
|
|
88
91
|
: value;
|
|
89
92
|
}
|