(consume2)
| 56227 | consume2.stream.on("end", function() { |
| 56228 | consumeEnd(this[kConsume]); |
| 56229 | }); |
| 56230 | } |
| 56231 | consume2.stream.resume(); |
| 56232 | while (consume2.stream.read() != null) { |
| 56233 | } |
| 56234 | } |
| 56235 | function consumeEnd(consume2) { |
| 56236 | const { type: type2, body, resolve, stream: stream4, length } = consume2; |
| 56237 | try { |
| 56238 | if (type2 === "text") { |
| 56239 | resolve(toUSVString(Buffer.concat(body))); |
| 56240 | } else if (type2 === "json") { |
| 56241 | resolve(JSON.parse(Buffer.concat(body))); |
| 56242 | } else if (type2 === "arrayBuffer") { |
| 56243 | const dst = new Uint8Array(length); |
| 56244 | let pos = 0; |
| 56245 | for (const buf of body) { |
| 56246 | dst.set(buf, pos); |
| 56247 | pos += buf.byteLength; |
| 56248 | } |
| 56249 | resolve(dst.buffer); |
| 56250 | } else if (type2 === "blob") { |
| 56251 | if (!Blob5) { |
| 56252 | Blob5 = require("buffer").Blob; |
| 56253 | } |
| 56254 | resolve(new Blob5(body, { type: stream4[kContentType] })); |
| 56255 | } |
| 56256 | consumeFinish(consume2); |
| 56257 | } catch (err) { |
no test coverage detected
searching dependent graphs…