(index: number, totalLines: number)
| 156 | } |
| 157 | |
| 158 | export function pageFor(index: number, totalLines: number): SourcePage { |
| 159 | const from = index * PAGE_LINES + 1; |
| 160 | return { |
| 161 | index, |
| 162 | from, |
| 163 | to: Math.min(totalLines, from + PAGE_LINES - 1), |
| 164 | requestFrom: Math.max(1, from - PAGE_LEAD_IN), |
| 165 | }; |
| 166 | } |
| 167 | |
| 168 | /** Every page index a rendered line range touches, in reading order. */ |
| 169 | export function pagesForRange(first: number, last: number, totalLines: number): number[] { |
no outgoing calls
no test coverage detected