* Build a `YAMLMap` for one entry with the right flow-style array fields.
(doc: Document, entry: AiModel)
| 116 | * Build a `YAMLMap` for one entry with the right flow-style array fields. |
| 117 | */ |
| 118 | function 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 |
no test coverage detected
searching dependent graphs…