@nestjs/common 7.6.8 → 7.6.9

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.
@@ -19,7 +19,7 @@ export interface ControllerOptions extends ScopeOptions {
19
19
  *
20
20
  * @see [Routing](https://docs.nestjs.com/controllers#routing)
21
21
  */
22
- host?: string;
22
+ host?: string | string[];
23
23
  }
24
24
  /**
25
25
  * Decorator that marks a class as a Nest controller that can receive inbound
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "7.6.8",
3
+ "version": "7.6.9",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -65,7 +65,30 @@ let ParseArrayPipe = class ParseArrayPipe {
65
65
  catch (_a) { }
66
66
  return this.validationPipe.transform(item, validationMetadata);
67
67
  };
68
- value = await Promise.all(value.map(toClassInstance));
68
+ if (this.options.stopAtFirstError === false) {
69
+ // strict compare to "false" to make sure
70
+ // that this option is disabled by default
71
+ let errors = [];
72
+ const targetArray = value;
73
+ for (let i = 0; i < targetArray.length; i++) {
74
+ try {
75
+ targetArray[i] = await toClassInstance(targetArray[i]);
76
+ }
77
+ catch (err) {
78
+ const message = err.getResponse
79
+ ? `[${i}] ` + err.getResponse().message
80
+ : err;
81
+ errors = errors.concat(message);
82
+ }
83
+ }
84
+ if (errors.length > 0) {
85
+ throw this.exceptionFactory(errors);
86
+ }
87
+ return targetArray;
88
+ }
89
+ else {
90
+ value = await Promise.all(value.map(toClassInstance));
91
+ }
69
92
  }
70
93
  return value;
71
94
  }