MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / lineAt

Function lineAt

graph-ui/src/provider/route-reader.ts:93–101  ·  view source on GitHub ↗

1-based line the character at `index` sits on.

(source: string, index: number)

Source from the content-addressed store, hash-verified

91
92/** 1-based line the character at `index` sits on. */
93function lineAt(source: string, index: number): number {
94 let line = 1;
95 for (let at = 0; at < index && at < source.length; at++) {
96 if (source[at] === '\n') {
97 line += 1;
98 }
99 }
100 return line;
101}
102
103/**
104 * Routes registered in one file.

Callers 2

readScriptRoutesFunction · 0.70
readAnnotationRoutesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected