MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / parseKeyValueStart

Function parseKeyValueStart

src/installer/targets/toml.ts:438–446  ·  view source on GitHub ↗

`key = …` at the start of a line → the key's decoded path.

(text: string)

Source from the content-addressed store, hash-verified

436
437/** `key = …` at the start of a line → the key's decoded path. */
438function parseKeyValueStart(text: string): { path: string[] | null; inlineTable: boolean } | null {
439 const start = skipWs(text, 0);
440 if (start >= text.length || text[start] === '#' || text[start] === '\r') return null;
441 const key = parseDottedKey(text, start);
442 if (!key) return null;
443 const eq = skipWs(text, key.end);
444 if (text[eq] !== '=') return null;
445 return { path: key.path, inlineTable: text[skipWs(text, eq + 1)] === '{' };
446}
447
448function skipWs(text: string, i: number): number {
449 while (i < text.length && (text[i] === ' ' || text[i] === '\t')) i++;

Callers 1

scanTomlStatementsFunction · 0.85

Calls 2

parseDottedKeyFunction · 0.85
skipWsFunction · 0.70

Tested by

no test coverage detected