@nestjs/common 9.3.3 → 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.
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const rxjs_1 = require("rxjs");
6
6
  const operators_1 = require("rxjs/operators");
7
7
  const decorators_1 = require("../../decorators");
8
+ const file_stream_1 = require("../../file-stream");
8
9
  const logger_service_1 = require("../../services/logger.service");
9
10
  const shared_utils_1 = require("../../utils/shared.utils");
10
11
  const cache_constants_1 = require("../cache.constants");
@@ -37,6 +38,9 @@ let CacheInterceptor = class CacheInterceptor {
37
38
  ? await ttlValueOrFactory(context)
38
39
  : ttlValueOrFactory;
39
40
  return next.handle().pipe((0, operators_1.tap)(async (response) => {
41
+ if (response instanceof file_stream_1.StreamableFile) {
42
+ return;
43
+ }
40
44
  const args = (0, shared_utils_1.isNil)(ttl) ? [key, response] : [key, response, { ttl }];
41
45
  try {
42
46
  await this.cacheManager.set(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "9.3.3",
3
+ "version": "9.3.5",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -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
- return Object.keys(this.validatorOptions).length > 0
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
  }