MCPcopy
hub / github.com/marimo-team/marimo / buildEntryNode

Function buildEntryNode

packages/llm-info/src/sync-models.ts:118–132  ·  view source on GitHub ↗

* Build a `YAMLMap` for one entry with the right flow-style array fields.

(doc: Document, entry: AiModel)

Source from the content-addressed store, hash-verified

116 * Build a `YAMLMap` for one entry with the right flow-style array fields.
117 */
118function buildEntryNode(doc: Document, entry: AiModel): YAMLMap {
119 const node = doc.createNode(flattenDates(entry)) as YAMLMap;
120 for (const pair of node.items) {
121 const key = (pair.key as { value?: unknown })?.value;
122 if (typeof key !== "string") {
123 continue;
124 }
125 if (FLOW_SEQ_KEYS.has(key) && isSeq(pair.value)) {
126 pair.value.flow = true;
127 } else if (FLOW_MAP_KEYS.has(key) && isMap(pair.value)) {
128 pair.value.flow = true;
129 }
130 }
131 return node;
132}
133
134/**
135 * Add a `provider: [...]` section to the root map, with a blank line before

Callers 2

renderFreshFunction · 0.85
insertIntoDocumentFunction · 0.85

Calls 3

flattenDatesFunction · 0.85
createNodeMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…