Function
safeCloseController
(
controller: ReadableStreamDefaultController<Uint8Array>,
)
Source from the content-addressed store, hash-verified
| 168 | } |
| 169 | |
| 170 | const safeCloseController = ( |
| 171 | controller: ReadableStreamDefaultController<Uint8Array>, |
| 172 | ) => { |
| 173 | if (streamClosed) return |
| 174 | streamClosed = true |
| 175 | try { |
| 176 | controller.close() |
| 177 | } catch { |
| 178 | // The consumer may have cancelled while a native read was pending. |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | const ensureStarted = () => { |
| 183 | if (!startPromise) { |
Tested by
no test coverage detected