(pathEntries: SessionPathEntry[], revealedCompactions: number)
| 106 | } |
| 107 | |
| 108 | function getSelectedCompactionIndex(pathEntries: SessionPathEntry[], revealedCompactions: number) { |
| 109 | if (revealedCompactions < 0) { |
| 110 | return -1 |
| 111 | } |
| 112 | |
| 113 | let remainingCompactionsToSkip = revealedCompactions |
| 114 | |
| 115 | for (let index = pathEntries.length - 1; index >= 0; index -= 1) { |
| 116 | if (pathEntries[index]?.type !== 'compaction') { |
| 117 | continue |
| 118 | } |
| 119 | |
| 120 | if (remainingCompactionsToSkip === 0) { |
| 121 | return index |
| 122 | } |
| 123 | |
| 124 | remainingCompactionsToSkip -= 1 |
| 125 | } |
| 126 | |
| 127 | return -1 |
| 128 | } |
| 129 | |
| 130 | function findEntryIndexById(pathEntries: SessionPathEntry[], entryId: string) { |
| 131 | for (let index = 0; index < pathEntries.length; index += 1) { |
no outgoing calls
no test coverage detected