@nestjs/core 8.0.5 → 8.0.6

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
@@ -108,6 +108,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
108
108
  <td align="center" valign="middle"><a href="https://www.bystored.com/" target="_blank"><img src="https://nestjs.com/img/stored-logo.svg" width="110" valign="middle" /></a></td>
109
109
  <td align="center" valign="middle"><a href="https://studyclerk.com/pay-for-research-paper" target="_blank"><img src="https://nestjs.com/img/studyclerk-logo.png" width="125" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://xyndata.com" target="_blank"><img src="https://nestjs.com/img/xyndata-logo.png" width="125" valign="middle" /></a></td></tr><tr>
110
110
  <td align="center" valign="middle"><a href="https://www.anonymistic.com/" target="_blank"><img src="https://nestjs.com/img/anonymistic-logo.png" width="125" valign="middle" /></a></td>
111
+ <td align="center" valign="middle"><a href="https://www.naologic.com/" target="_blank"><img src="https://nestjs.com/img/naologic-logo.svg" width="125" valign="middle" /></a></td>
111
112
  </tr></table>
112
113
 
113
114
  ## Backers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/core",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@core)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "uuid": "8.3.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@nestjs/common": "8.0.5"
39
+ "@nestjs/common": "8.0.6"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@nestjs/common": "^8.0.0",
@@ -12,6 +12,7 @@ export declare class RouterModule {
12
12
  private readonly routes;
13
13
  constructor(modulesContainer: ModulesContainer, routes: Routes);
14
14
  static register(routes: Routes): DynamicModule;
15
+ private deepCloneRoutes;
15
16
  private initialize;
16
17
  private registerModulePathMetadata;
17
18
  private updateTargetModulesCache;
@@ -17,6 +17,7 @@ let RouterModule = RouterModule_1 = class RouterModule {
17
17
  constructor(modulesContainer, routes) {
18
18
  this.modulesContainer = modulesContainer;
19
19
  this.routes = routes;
20
+ this.routes = this.deepCloneRoutes(routes);
20
21
  this.initialize();
21
22
  }
22
23
  static register(routes) {
@@ -30,6 +31,17 @@ let RouterModule = RouterModule_1 = class RouterModule {
30
31
  ],
31
32
  };
32
33
  }
34
+ deepCloneRoutes(routes) {
35
+ return routes.map((routeOrType) => {
36
+ if (typeof routeOrType === 'function') {
37
+ return routeOrType;
38
+ }
39
+ if (routeOrType.children) {
40
+ return Object.assign(Object.assign({}, routeOrType), { children: this.deepCloneRoutes(routeOrType.children) });
41
+ }
42
+ return Object.assign({}, routeOrType);
43
+ });
44
+ }
33
45
  initialize() {
34
46
  const flattenedRoutes = utils_1.flattenRoutePaths(this.routes);
35
47
  flattenedRoutes.forEach(route => {
package/scanner.js CHANGED
@@ -166,8 +166,10 @@ class DependenciesScanner {
166
166
  modulesStack.push(moduleRef);
167
167
  const moduleImports = moduleRef.imports;
168
168
  moduleImports.forEach(importedModuleRef => {
169
- importedModuleRef.distance = distance;
170
- calculateDistance(importedModuleRef, distance + 1);
169
+ if (importedModuleRef) {
170
+ importedModuleRef.distance = distance;
171
+ calculateDistance(importedModuleRef, distance + 1);
172
+ }
171
173
  });
172
174
  };
173
175
  const rootModule = modulesGenerator.next().value;