MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / lineAt

Function lineAt

packages/plugins/openapi/src/sdk/split.ts:95–108  ·  view source on GitHub ↗
(text: string, from: number, limit: number)

Source from the content-addressed store, hash-verified

93 * the scalar key, tracked by the caller) are still returned; the caller skips
94 * them. */
95const lineAt = (text: string, from: number, limit: number): LineCursor | null => {
96 if (from >= limit) return null;
97 let lineEnd = text.indexOf("\n", from);
98 if (lineEnd === -1 || lineEnd > limit) lineEnd = limit;
99 const indent = indentOf(text, from, lineEnd);
100 const contentStart = from + indent;
101 return {
102 lineStart: from,
103 lineEnd,
104 nextStart: lineEnd + 1,
105 indent,
106 contentStart,
107 };
108};
109
110/**
111 * Find the start offset of every key line at exactly `indent` within

Callers 3

keyLineStartsAtIndentFunction · 0.85
structuralSplitFunction · 0.85
indexSchemasFunction · 0.85

Calls 1

indentOfFunction · 0.85

Tested by

no test coverage detected