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

Method getLineStart

src/extraction/liquid-extractor.ts:536–542  ·  view source on GitHub ↗

* Get the character index of the start of a line

(lineNumber: number)

Source from the content-addressed store, hash-verified

534 * Get the character index of the start of a line
535 */
536 private getLineStart(lineNumber: number): number {
537 const starts = this.lineStarts();
538 const line = Math.ceil(lineNumber) - 1;
539 if (!(line > 0)) return 0;
540 // Past the last line: where a line after it would start.
541 return line < starts.length ? starts[line]! : this.source.length + 1;
542 }
543
544 /**
545 * Where each line of the source starts, read once. Both lookups above read

Callers 5

extractSchemaMethod · 0.95
addVariableMethod · 0.95

Calls 1

lineStartsMethod · 0.95

Tested by

no test coverage detected