(url: string, req: RequestInit = {})
| 6 | sizeLeft = 0; |
| 7 | ready: Promise<void>; |
| 8 | constructor(url: string, req: RequestInit = {}) { |
| 9 | this.controller = new AbortController(); |
| 10 | this.ready = fetch(url, { |
| 11 | ...req, |
| 12 | signal: this.controller.signal, |
| 13 | }).then(async (f) => { |
| 14 | if (!f.ok || !f.body) { |
| 15 | throw new Error("request not ok"); |
| 16 | } |
| 17 | const read = f.body.getReader(); |
| 18 | this.cbuff = (await read.read()).value; |
| 19 | this.read = read; |
| 20 | }); |
| 21 | } |
| 22 | async next() { |
| 23 | return (await this.get8BitArray(1))[0]; |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected