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

Function keyNameAt

packages/plugins/openapi/src/sdk/split.ts:150–155  ·  view source on GitHub ↗
(text: string, lineStart: number, lineEnd: number)

Source from the content-addressed store, hash-verified

148
149/** The simple (unquoted) key name on a key line, e.g. `paths`, `schemas`. */
150const keyNameAt = (text: string, lineStart: number, lineEnd: number): string => {
151 const indent = indentOf(text, lineStart, lineEnd);
152 const colon = text.indexOf(":", lineStart + indent);
153 const keyEnd = colon === -1 || colon > lineEnd ? lineEnd : colon;
154 return text.slice(lineStart + indent, keyEnd).trim();
155};
156
157/**
158 * Scan a document into its structural ranges. Pure and synchronous; never

Callers 2

structuralSplitFunction · 0.85
indexSchemasFunction · 0.85

Calls 1

indentOfFunction · 0.85

Tested by

no test coverage detected