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

Function lineAt

src/extraction/sfc-script.ts:422–426  ·  view source on GitHub ↗
(offset: number)

Source from the content-addressed store, hash-verified

420 let line = 0;
421 let counted = 0;
422 const lineAt = (offset: number): number => {
423 for (let at = source.indexOf('\n', counted); at >= 0 && at < offset; at = source.indexOf('\n', at + 1)) line++;
424 counted = offset;
425 return line;
426 };
427 for (const element of elements) {
428 if (element.content === undefined) continue;
429 const start = lineAt(element.index);

Callers 1

sfcElementLineRangesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected