MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / pageFor

Function pageFor

ui/src/lib/filecode-model.ts:158–166  ·  view source on GitHub ↗
(index: number, totalLines: number)

Source from the content-addressed store, hash-verified

156}
157
158export 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. */
169export function pagesForRange(first: number, last: number, totalLines: number): number[] {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected