Swap the outranked module edges for their references, for the sweep. Returns how many.
(queries: QueryBuilder, outranked: readonly OutrankedImport[])
| 655 | |
| 656 | /** Swap the outranked module edges for their references, for the sweep. Returns how many. */ |
| 657 | function reopenModuleEdges(queries: QueryBuilder, outranked: readonly OutrankedImport[]): number { |
| 658 | const edgeIds: number[] = []; |
| 659 | const refs: UnresolvedReference[] = []; |
| 660 | for (const { edge } of outranked) { |
| 661 | const ref = resurrectRefFromDroppedEdge(edge); |
| 662 | if (!ref || edgeIds.includes(edge.edgeId)) continue; |
| 663 | edgeIds.push(edge.edgeId); |
| 664 | refs.push(ref); |
| 665 | } |
| 666 | if (refs.length > 0) queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs); |
| 667 | return refs.length; |
| 668 | } |
| 669 | |
| 670 | /** |
| 671 | * The files with an import statement naming one of `files`, or one of the |
no test coverage detected