(id: string)
| 123 | // ── Outputs (declaration + assignment bundled) ───────────────────────────────── |
| 124 | |
| 125 | export function addOutput(id: string): void { |
| 126 | mutate( |
| 127 | id, |
| 128 | (fn) => { |
| 129 | const dataType: DataType = "string"; |
| 130 | return { |
| 131 | ...fn, |
| 132 | outputs: [...fn.outputs, { uid: generateId(), name: `output${fn.outputs.length + 1}`, dataType, expression: emptyExpression(dataType) }], |
| 133 | }; |
| 134 | }, |
| 135 | true, |
| 136 | ); |
| 137 | } |
| 138 | |
| 139 | /** Update an output's declaration (name/dataType). A dataType change retags the |
| 140 | * bundled expression's dataType but keeps the entered text. */ |
no test coverage detected