MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / getLineStarts

Function getLineStarts

packages/cli/src/transform.ts:761–767  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

759}
760
761function getLineStarts(source: string): number[] {
762 const starts = [0];
763 for (let i = 0; i < source.length; i++) {
764 if (source[i] === "\n") starts.push(i + 1);
765 }
766 return starts;
767}
768
769function getNodeIndex(node: any, edge: "start" | "end", lineStarts: number[]): number | null {
770 const direct = edge === "start" ? node.start : node.end;

Callers 5

getSourceBetweenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected