@whatwg-node/node-fetch 0.5.7 → 0.5.8-alpha-20240312161556-e6d3e27cadcaaa8338844ba5d1ab398c9828c328

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/Headers.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PonyfillHeaders = exports.isHeadersLike = void 0;
4
- const node_util_1 = require("node:util");
4
+ const util_1 = require("util");
5
5
  function isHeadersLike(headers) {
6
6
  return headers?.get && headers?.forEach;
7
7
  }
@@ -238,7 +238,7 @@ class PonyfillHeaders {
238
238
  record[key] = value.includes(',') ? value.split(',').map(el => el.trim()) : value;
239
239
  }
240
240
  });
241
- return `Headers ${(0, node_util_1.inspect)(record)}`;
241
+ return `Headers ${(0, util_1.inspect)(record)}`;
242
242
  }
243
243
  }
244
244
  exports.PonyfillHeaders = PonyfillHeaders;
package/cjs/fetchCurl.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchCurl = void 0;
4
- const node_stream_1 = require("node:stream");
4
+ const stream_1 = require("stream");
5
5
  const Response_js_1 = require("./Response.js");
6
6
  const utils_js_1 = require("./utils.js");
7
7
  function fetchCurl(fetchRequest) {
@@ -25,7 +25,7 @@ function fetchCurl(fetchRequest) {
25
25
  const nodeReadable = (fetchRequest.body != null
26
26
  ? (0, utils_js_1.isNodeReadable)(fetchRequest.body)
27
27
  ? fetchRequest.body
28
- : node_stream_1.Readable.from(fetchRequest.body)
28
+ : stream_1.Readable.from(fetchRequest.body)
29
29
  : null);
30
30
  if (nodeReadable) {
31
31
  curlHandle.setOpt('UPLOAD', true);
@@ -73,7 +73,7 @@ function fetchCurl(fetchRequest) {
73
73
  curlHandle.close();
74
74
  });
75
75
  curlHandle.once('stream', function streamListener(stream, status, headersBuf) {
76
- const pipedStream = stream.pipe(new node_stream_1.PassThrough());
76
+ const pipedStream = stream.pipe(new stream_1.PassThrough());
77
77
  const headersFlat = headersBuf
78
78
  .toString('utf8')
79
79
  .split(/\r?\n|\r/g)
package/esm/Headers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { inspect } from 'node:util';
1
+ import { inspect } from 'util';
2
2
  export function isHeadersLike(headers) {
3
3
  return headers?.get && headers?.forEach;
4
4
  }
package/esm/fetchCurl.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PassThrough, Readable } from 'node:stream';
1
+ import { PassThrough, Readable } from 'stream';
2
2
  import { PonyfillResponse } from './Response.js';
3
3
  import { defaultHeadersSerializer, isNodeReadable } from './utils.js';
4
4
  export function fetchCurl(fetchRequest) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.5.7",
3
+ "version": "0.5.8-alpha-20240312161556-e6d3e27cadcaaa8338844ba5d1ab398c9828c328",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
@@ -21,7 +21,7 @@ export declare class PonyfillRequest<TJSON = any> extends PonyfillBody<TJSON> im
21
21
  keepalive: boolean;
22
22
  method: string;
23
23
  mode: RequestMode;
24
- priority: string;
24
+ priority: 'auto' | 'high' | 'low';
25
25
  redirect: RequestRedirect;
26
26
  referrer: string;
27
27
  referrerPolicy: ReferrerPolicy;
@@ -21,7 +21,7 @@ export declare class PonyfillRequest<TJSON = any> extends PonyfillBody<TJSON> im
21
21
  keepalive: boolean;
22
22
  method: string;
23
23
  mode: RequestMode;
24
- priority: string;
24
+ priority: 'auto' | 'high' | 'low';
25
25
  redirect: RequestRedirect;
26
26
  referrer: string;
27
27
  referrerPolicy: ReferrerPolicy;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { Readable } from 'node:stream';
2
+ import { Readable } from 'stream';
3
3
  export declare function getHeadersObj(headers: Headers): Record<string, string>;
4
4
  export declare function defaultHeadersSerializer(headers: Headers, onContentLength?: (value: string) => void): string[];
5
5
  export declare function fakePromise<T>(value: T): Promise<T>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { Readable } from 'node:stream';
2
+ import { Readable } from 'stream';
3
3
  export declare function getHeadersObj(headers: Headers): Record<string, string>;
4
4
  export declare function defaultHeadersSerializer(headers: Headers, onContentLength?: (value: string) => void): string[];
5
5
  export declare function fakePromise<T>(value: T): Promise<T>;