(frame: Uint8Array)
| 116 | |
| 117 | // Helper to enqueue a frame, ignoring errors if stream is closed/cancelled |
| 118 | const enqueue = (frame: Uint8Array): boolean => { |
| 119 | if (cancelled) return false |
| 120 | try { |
| 121 | controller.enqueue(frame) |
| 122 | return true |
| 123 | } catch { |
| 124 | return false |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | // Helper to error the output stream (for fatal errors like JSON stream failure) |
| 129 | const errorOutput = (error: unknown): void => { |
no test coverage detected