(
mod: EvaluatedModuleNode,
callstack: string[],
visited = new Set<string>(),
)
| 134 | } |
| 135 | |
| 136 | private isCircularRequest( |
| 137 | mod: EvaluatedModuleNode, |
| 138 | callstack: string[], |
| 139 | visited = new Set<string>(), |
| 140 | ): boolean { |
| 141 | if (visited.has(mod.id)) { |
| 142 | return false |
| 143 | } |
| 144 | visited.add(mod.id) |
| 145 | |
| 146 | for (const importedModuleId of mod.imports) { |
| 147 | if (callstack.includes(importedModuleId)) { |
| 148 | return true |
| 149 | } |
| 150 | |
| 151 | const importedModule = |
| 152 | this.evaluatedModules.getModuleById(importedModuleId) |
| 153 | if ( |
| 154 | importedModule?.promise && |
| 155 | !importedModule.evaluated && |
| 156 | this.isCircularRequest(importedModule, callstack, visited) |
| 157 | ) { |
| 158 | return true |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | return false |
| 163 | } |
| 164 | |
| 165 | private async cachedRequest( |
| 166 | url: string, |
no test coverage detected