@nestjs/common 8.4.6 → 8.4.7

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
@@ -65,19 +65,20 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
65
65
  <td>
66
66
  <a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
67
67
  <td>
68
- <a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
68
+ <a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td><td>
69
+ <a href="https://amplication.com/" target="_blank"><img src="https://nestjs.com/img/amplication-logo.svg" width="190" valign="middle" /></a></td>
69
70
  </tr></table>
70
71
 
71
72
  #### Gold Sponsors
72
73
 
73
74
  <table style="text-align:center;"><tr><td>
74
- <a href="https://careers.labster.com/departments/platform" target="_blank"><img src="https://nestjs.com/img/labster-logo.png" width="170" valign="middle" /></a></td><td>
75
75
  <a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
76
76
  <td>
77
77
  <a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
78
78
  <td>
79
79
  <a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
80
- <a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td></</tr></table>
80
+ <a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td><td>
81
+ <a href="https://fuseautotech.com/" target="_blank"><img src="https://nestjs.com/img/fuse-logo.svg" width="105" valign="middle" /></a></td></</tr></table>
81
82
 
82
83
  #### Silver Sponsors
83
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "8.4.6",
3
+ "version": "8.4.7",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -34,7 +34,7 @@ export declare class ValidationPipe implements PipeTransform<any> {
34
34
  protected toValidate(metadata: ArgumentMetadata): boolean;
35
35
  protected transformPrimitive(value: any, metadata: ArgumentMetadata): any;
36
36
  protected toEmptyIfNil<T = any, R = any>(value: T): R | {};
37
- protected stripProtoKeys(value: Record<string, any>): void;
37
+ protected stripProtoKeys(value: any): void;
38
38
  protected isPrimitive(value: unknown): boolean;
39
39
  protected validate(object: object, validatorOptions?: ValidatorOptions): Promise<ValidationError[]> | ValidationError[];
40
40
  protected flattenValidationErrors(validationErrors: ValidationError[]): string[];
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ValidationPipe = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const iterare_1 = require("iterare");
6
+ const util_1 = require("util");
6
7
  const decorators_1 = require("../decorators");
7
8
  const core_1 = require("../decorators/core");
8
9
  const http_status_enum_1 = require("../enums/http-status.enum");
@@ -118,11 +119,21 @@ let ValidationPipe = class ValidationPipe {
118
119
  return (0, shared_utils_1.isNil)(value) ? {} : value;
119
120
  }
120
121
  stripProtoKeys(value) {
122
+ if (value == null ||
123
+ typeof value !== 'object' ||
124
+ util_1.types.isTypedArray(value)) {
125
+ return;
126
+ }
127
+ if (Array.isArray(value)) {
128
+ for (const v of value) {
129
+ this.stripProtoKeys(v);
130
+ }
131
+ return;
132
+ }
121
133
  delete value.__proto__;
122
- const keys = Object.keys(value);
123
- (0, iterare_1.iterate)(keys)
124
- .filter(key => (0, shared_utils_1.isObject)(value[key]) && value[key])
125
- .forEach(key => this.stripProtoKeys(value[key]));
134
+ for (const key in value) {
135
+ this.stripProtoKeys(value[key]);
136
+ }
126
137
  }
127
138
  isPrimitive(value) {
128
139
  return ['number', 'boolean', 'string'].includes(typeof value);