()
| 410 | } |
| 411 | |
| 412 | public calculateModulesDistance() { |
| 413 | const modulesGenerator = this.container.getModules().values(); |
| 414 | // Skip "InternalCoreModule" |
| 415 | // The second element is the actual root module |
| 416 | modulesGenerator.next(); |
| 417 | |
| 418 | const rootModule = modulesGenerator.next().value!; |
| 419 | if (!rootModule) { |
| 420 | return; |
| 421 | } |
| 422 | |
| 423 | // Convert modules to an acyclic connected graph |
| 424 | const tree = new TopologyTree(rootModule); |
| 425 | tree.walk((moduleRef, depth) => { |
| 426 | if (moduleRef.isGlobal) { |
| 427 | return; |
| 428 | } |
| 429 | moduleRef.distance = depth; |
| 430 | }); |
| 431 | } |
| 432 | |
| 433 | public async insertImport(related: any, token: string, context: string) { |
| 434 | if (isUndefined(related)) { |
no test coverage detected