Swap the outranked module edges for their references, for the sweep. Returns how many.
(queries: QueryBuilder, outranked: readonly OutrankedImport[])
| 540 | |
| 541 | /** Swap the outranked module edges for their references, for the sweep. Returns how many. */ |
| 542 | function reopenModuleEdges(queries: QueryBuilder, outranked: readonly OutrankedImport[]): number { |
| 543 | const edgeIds: number[] = []; |
| 544 | const refs: UnresolvedReference[] = []; |
| 545 | for (const { edge } of outranked) { |
| 546 | const ref = resurrectRefFromDroppedEdge(edge); |
| 547 | if (!ref || edgeIds.includes(edge.edgeId)) continue; |
| 548 | edgeIds.push(edge.edgeId); |
| 549 | refs.push(ref); |
| 550 | } |
| 551 | if (refs.length > 0) queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs); |
| 552 | return refs.length; |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * The files with an import statement naming one of `files`, or one of the |
no test coverage detected