(frame: RuntimeFrame)
| 40 | } |
| 41 | |
| 42 | function decodeFrame(frame: RuntimeFrame): WorkspaceRuntimeEvent<ExecEncoding> { |
| 43 | if (frame.name === "exit" || frame.name === "result") return frame; |
| 44 | return { |
| 45 | id: frame.id, |
| 46 | seq: frame.seq, |
| 47 | name: frame.name, |
| 48 | value: frame.enc === "utf8" ? frame.value : fromBase64(frame.value), |
| 49 | }; |
| 50 | } |
| 51 | |
| 52 | export function decodeRuntimeEvents( |
| 53 | source: ReadableStream<Uint8Array>, |
no test coverage detected