MCPcopy Create free account
hub / github.com/Noumena-Network/code / getLineStartOffsets

Function getLineStartOffsets

src/utils/markdown.ts:108–116  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

106}
107
108function getLineStartOffsets(lines: string[]): number[] {
109 const offsets: number[] = []
110 let offset = 0
111 for (const line of lines) {
112 offsets.push(offset)
113 offset += line.length + 1
114 }
115 return offsets
116}
117
118function sliceContentByLines(
119 content: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected