@whatwg-node/node-fetch
Advanced tools
Comparing version 0.7.8-alpha-20250122135352-8725fae5bc92fc13604dae0e2038a3c5bb034384 to 0.7.8-alpha-20250122135701-d1a6e1b2227c25bd4b427747363078b8b9d744ad
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createFetchUndici = createFetchUndici; | ||
const stream_1 = require("stream"); | ||
const types_1 = require("util/types"); | ||
const zlib_1 = require("zlib"); | ||
const node_stream_1 = require("node:stream"); | ||
const types_1 = require("node:util/types"); | ||
const node_zlib_1 = require("node:zlib"); | ||
const fetchNodeHttp_js_1 = require("./fetchNodeHttp.js"); | ||
@@ -28,3 +28,3 @@ const Request_js_1 = require("./Request.js"); | ||
(0, types_1.isUint8Array)(bodyInit) || | ||
bodyInit instanceof stream_1.Readable) { | ||
bodyInit instanceof node_stream_1.Readable) { | ||
body = bodyInit; | ||
@@ -37,3 +37,3 @@ } | ||
else { | ||
body = stream_1.Readable.from(fetchRequest.body); | ||
body = node_stream_1.Readable.from(fetchRequest.body); | ||
} | ||
@@ -46,17 +46,17 @@ } | ||
case 'gzip': | ||
passthrough = (0, zlib_1.createGunzip)(); | ||
passthrough = (0, node_zlib_1.createGunzip)(); | ||
break; | ||
case 'x-deflate': | ||
case 'deflate': | ||
passthrough = (0, zlib_1.createInflate)(); | ||
passthrough = (0, node_zlib_1.createInflate)(); | ||
break; | ||
case 'x-deflate-raw': | ||
case 'deflate-raw': | ||
passthrough = (0, zlib_1.createInflateRaw)(); | ||
passthrough = (0, node_zlib_1.createInflateRaw)(); | ||
break; | ||
case 'br': | ||
passthrough = (0, zlib_1.createBrotliDecompress)(); | ||
passthrough = (0, node_zlib_1.createBrotliDecompress)(); | ||
break; | ||
default: | ||
passthrough = new stream_1.PassThrough(); | ||
passthrough = new node_stream_1.PassThrough(); | ||
} | ||
@@ -164,3 +164,3 @@ return passthrough; | ||
}); | ||
passthrough ||= new stream_1.PassThrough(); | ||
passthrough ||= new node_stream_1.PassThrough(); | ||
resolve(new Response_js_1.PonyfillResponse(passthrough, { | ||
@@ -167,0 +167,0 @@ status: statusCode, |
@@ -1,4 +0,4 @@ | ||
import { PassThrough, Readable } from 'stream'; | ||
import { isUint8Array } from 'util/types'; | ||
import { createBrotliDecompress, createGunzip, createInflate, createInflateRaw } from 'zlib'; | ||
import { PassThrough, Readable } from 'node:stream'; | ||
import { isUint8Array } from 'node:util/types'; | ||
import { createBrotliDecompress, createGunzip, createInflate, createInflateRaw } from 'node:zlib'; | ||
import { fetchNodeHttp } from './fetchNodeHttp.js'; | ||
@@ -5,0 +5,0 @@ import { PonyfillRequest } from './Request.js'; |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.7.8-alpha-20250122135352-8725fae5bc92fc13604dae0e2038a3c5bb034384", | ||
"version": "0.7.8-alpha-20250122135701-d1a6e1b2227c25bd4b427747363078b8b9d744ad", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
246027