MCPcopy Create free account
hub / github.com/arktypeio/arktype / computeLineStarts

Function computeLineStarts

ark/aot/module.ts:312–317  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

310}
311
312const computeLineStarts = (source: string): number[] => {
313 const result = [0]
314 for (let i = 0; i < source.length; i++)
315 if (source[i] === "\n") result.push(i + 1)
316 return result
317}

Callers 1

lineAndColumnOfMethod · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected