MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / inlineMap

Function inlineMap

graph-ui/src/browser-ai/file-outline.ts:147–150  ·  view source on GitHub ↗

A mapping on one line: "repo `x`; rev `y`; hooks (1): `black` (exclude `z`)".

(value: Extract<YamlValue, { kind: 'map' }>, depth: number, words: Words)

Source from the content-addressed store, hash-verified

145
146/** A mapping on one line: "repo `x`; rev `y`; hooks (1): `black` (exclude `z`)". */
147function inlineMap(value: Extract<YamlValue, { kind: 'map' }>, depth: number, words: Words): string {
148 if (!value.entries.length) return words.empty;
149 return value.entries.slice(0, FIELDS).map(([key, item]) => field(key, item, depth, words)).join('; ') + more(value.entries.length, FIELDS, words);
150}
151function field(key: string, value: YamlValue, depth: number, words: Words): string {
152 if (value.kind === 'scalar') return `${key} ${scalarText(value, words)}`;
153 if (value.kind === 'map') return depth < 2 ? `${key}: ${inlineMap(value, depth + 1, words)}` : `${key} (${words.keys(value.entries.length)})`;

Callers 3

fieldFunction · 0.85
namedFunction · 0.85
entryLinesFunction · 0.85

Calls 2

fieldFunction · 0.70
moreFunction · 0.70

Tested by

no test coverage detected