(data, encoding)
| 356 | } |
| 357 | |
| 358 | function decode(data, encoding) { |
| 359 | if (encoding.toLowerCase() === "json") { |
| 360 | return JSON.parse(data); |
| 361 | } |
| 362 | return data; |
| 363 | } |
| 364 | |
| 365 | // ======================================== |
| 366 | // STREAM CONVERSION (fetch ... as Stream) |