( runner: ModuleRunner, modules: string[], visited = new Set<string>(), entrypoints = new Set<string>(), )
| 95 | } |
| 96 | |
| 97 | function getModulesEntrypoints( |
| 98 | runner: ModuleRunner, |
| 99 | modules: string[], |
| 100 | visited = new Set<string>(), |
| 101 | entrypoints = new Set<string>(), |
| 102 | ) { |
| 103 | for (const moduleId of modules) { |
| 104 | if (visited.has(moduleId)) continue |
| 105 | visited.add(moduleId) |
| 106 | const module = runner.evaluatedModules.getModuleById(moduleId) |
| 107 | if (!module) { |
| 108 | continue |
| 109 | } |
| 110 | if (!module.importers.size) { |
| 111 | entrypoints.add(module.url) |
| 112 | continue |
| 113 | } |
| 114 | for (const importer of module.importers) { |
| 115 | getModulesEntrypoints(runner, [importer], visited, entrypoints) |
| 116 | } |
| 117 | } |
| 118 | return entrypoints |
| 119 | } |
| 120 | |
| 121 | function findAllEntrypoints( |
| 122 | runner: ModuleRunner, |
no test coverage detected