@nestjs/common 11.1.19 → 11.1.21

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/Readme.md CHANGED
@@ -29,7 +29,7 @@ Nest is a framework for building efficient, scalable <a href="https://nodejs.org
29
29
 
30
30
  ## Philosophy
31
31
 
32
- <p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like <a href="https://angular.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a>, and <a href="https://github.com/vuejs/vue" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
32
+ <p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like <a href="https://angular.dev/" target="_blank">Angular</a>, <a href="https://react.dev/" target="_blank">React</a>, and <a href="https://vuejs.org/" target="_blank">Vue</a>, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.</p>
33
33
  <p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.</p>
34
34
 
35
35
  ## Getting started
@@ -95,6 +95,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
95
95
  <td align="center" valign="middle"><a href="https://crawljobs.com" target="_blank"><img src="https://nestjs.com/img/logos/crawljobs-logo.svg" width="130" valign="middle" /></a></td>
96
96
  </tr><tr>
97
97
  <td align="center" valign="middle"><a href="https://pandektes.com" target="_blank"><img src="https://nestjs.com/img/logos/pandektes-logo.png" width="65" valign="middle" /></a></td>
98
+ <td align="center" valign="middle"><a href="https://www.fintechcrafts.com/" target="_blank"><img src="https://nestjs.com/img/logos/fintechcrafts-logo.svg" width="65" valign="middle" /></a></td>
98
99
  </tr>
99
100
  </table>
100
101
 
@@ -30,6 +30,7 @@ function UsePipes(...pipes) {
30
30
  return (target, key, descriptor) => {
31
31
  const isPipeValid = (pipe) => pipe && ((0, shared_utils_1.isFunction)(pipe) || (0, shared_utils_1.isFunction)(pipe.transform));
32
32
  if (descriptor) {
33
+ (0, validate_each_util_1.validateEach)(target.constructor, pipes, isPipeValid, '@UsePipes', 'pipe');
33
34
  (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.PIPES_METADATA, pipes, descriptor.value);
34
35
  return descriptor;
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "11.1.19",
3
+ "version": "11.1.21",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -38,5 +38,5 @@
38
38
  "optional": true
39
39
  }
40
40
  },
41
- "gitHead": "67309956821c0626c050fe6725c90645d2577e3d"
41
+ "gitHead": "983dd52c4927753be3421162fc43e4fde8d3fcde"
42
42
  }
@@ -23,6 +23,18 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
23
23
  ? errorMessage({ file, config })
24
24
  : errorMessage;
25
25
  }
26
+ /**
27
+ * If the file buffer is not available, and fallbackToMimetype is not enabled,
28
+ * we cannot perform magic number validation,
29
+ * so we return a specific error message indicating
30
+ * that validation could not be performed due to missing buffer.
31
+ */
32
+ if (file?.mimetype &&
33
+ !file.buffer &&
34
+ !this.validationOptions?.fallbackToMimetype &&
35
+ !this.validationOptions?.skipMagicNumbersValidation) {
36
+ return `Validation failed (file buffer is not available; file type validation could not be performed; expected type is ${this.validationOptions.fileType})`;
37
+ }
26
38
  if (file?.mimetype) {
27
39
  const baseMessage = `Validation failed (current file type is ${file.mimetype}, expected type is ${this.validationOptions.fileType})`;
28
40
  /**
@@ -25,7 +25,7 @@ let ParseDatePipe = class ParseDatePipe {
25
25
  if (this.options.optional && (0, shared_utils_1.isNil)(value)) {
26
26
  return this.options.default ? this.options.default() : value;
27
27
  }
28
- if (!value) {
28
+ if ((0, shared_utils_1.isNil)(value) || value === '') {
29
29
  throw this.exceptionFactory('Validation failed (no Date provided)');
30
30
  }
31
31
  const transformedValue = new Date(value);