(w, byteOffset, value)
| 232 | // alternately concat-then-patch, but patching the parts keeps construction |
| 233 | // order simple. |
| 234 | function patchU32WriterPart(w, byteOffset, value) { |
| 235 | let off = 0; |
| 236 | for (const part of w.parts) { |
| 237 | if (byteOffset >= off && byteOffset < off + part.length) { |
| 238 | new DataView(part.buffer, part.byteOffset, part.byteLength).setUint32( |
| 239 | byteOffset - off, |
| 240 | value, |
| 241 | true, |
| 242 | ); |
| 243 | return; |
| 244 | } |
| 245 | off += part.length; |
| 246 | } |
| 247 | throw new Error("patchU32: offset out of range"); |
| 248 | } |
| 249 | |
| 250 | async function deflateZlib(bytes) { |
| 251 | const stream = new Response(bytes).body.pipeThrough( |
no outgoing calls
no test coverage detected