(id: string, row: EventRow)
| 208 | } |
| 209 | |
| 210 | function materialise(id: string, row: EventRow): ExecEvent { |
| 211 | if (row.kind === KIND_EXIT) { |
| 212 | // node:sqlite returns BLOB as Uint8Array; we need the bytes |
| 213 | // view to read the int32. |
| 214 | const view = new DataView(row.value.buffer, row.value.byteOffset, row.value.byteLength); |
| 215 | return { id, seq: row.seq, name: "exit", value: view.getInt32(0, true) }; |
| 216 | } |
| 217 | const name = row.kind === KIND_STDOUT ? "stdout" : "stderr"; |
| 218 | return { id, seq: row.seq, name, value: row.value }; |
| 219 | } |