@whatwg-node/node-fetch 0.5.21 → 0.5.22-rc-20240814161624-cedbcd0dabfe3f85518af06aa23351ec7ee8ef53

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.
@@ -4,6 +4,9 @@ exports.PonyfillCompressionStream = void 0;
4
4
  const node_zlib_1 = require("node:zlib");
5
5
  const TransformStream_js_1 = require("./TransformStream.js");
6
6
  class PonyfillCompressionStream extends TransformStream_js_1.PonyfillTransformStream {
7
+ static supportedFormats = globalThis.process?.version?.startsWith('v2')
8
+ ? ['gzip', 'deflate', 'br']
9
+ : ['gzip', 'deflate', 'deflate-raw', 'br'];
7
10
  constructor(compressionFormat) {
8
11
  switch (compressionFormat) {
9
12
  case 'x-gzip':
@@ -4,6 +4,9 @@ exports.PonyfillDecompressionStream = void 0;
4
4
  const node_zlib_1 = require("node:zlib");
5
5
  const TransformStream_js_1 = require("./TransformStream.js");
6
6
  class PonyfillDecompressionStream extends TransformStream_js_1.PonyfillTransformStream {
7
+ static supportedFormats = globalThis.process?.version?.startsWith('v2')
8
+ ? ['gzip', 'deflate', 'br']
9
+ : ['gzip', 'deflate', 'deflate-raw', 'br'];
7
10
  constructor(compressionFormat) {
8
11
  switch (compressionFormat) {
9
12
  case 'x-gzip':
@@ -21,7 +24,7 @@ class PonyfillDecompressionStream extends TransformStream_js_1.PonyfillTransform
21
24
  super((0, node_zlib_1.createBrotliDecompress)());
22
25
  break;
23
26
  default:
24
- throw new Error(`Unsupported compression format: ${compressionFormat}`);
27
+ throw new TypeError(`Unsupported compression format: '${compressionFormat}'`);
25
28
  }
26
29
  }
27
30
  }
@@ -1,6 +1,9 @@
1
1
  import { createBrotliCompress, createDeflate, createDeflateRaw, createGzip } from 'node:zlib';
2
2
  import { PonyfillTransformStream } from './TransformStream.js';
3
3
  export class PonyfillCompressionStream extends PonyfillTransformStream {
4
+ static supportedFormats = globalThis.process?.version?.startsWith('v2')
5
+ ? ['gzip', 'deflate', 'br']
6
+ : ['gzip', 'deflate', 'deflate-raw', 'br'];
4
7
  constructor(compressionFormat) {
5
8
  switch (compressionFormat) {
6
9
  case 'x-gzip':
@@ -1,6 +1,9 @@
1
1
  import { createBrotliDecompress, createGunzip, createInflate, createInflateRaw } from 'node:zlib';
2
2
  import { PonyfillTransformStream } from './TransformStream.js';
3
3
  export class PonyfillDecompressionStream extends PonyfillTransformStream {
4
+ static supportedFormats = globalThis.process?.version?.startsWith('v2')
5
+ ? ['gzip', 'deflate', 'br']
6
+ : ['gzip', 'deflate', 'deflate-raw', 'br'];
4
7
  constructor(compressionFormat) {
5
8
  switch (compressionFormat) {
6
9
  case 'x-gzip':
@@ -18,7 +21,7 @@ export class PonyfillDecompressionStream extends PonyfillTransformStream {
18
21
  super(createBrotliDecompress());
19
22
  break;
20
23
  default:
21
- throw new Error(`Unsupported compression format: ${compressionFormat}`);
24
+ throw new TypeError(`Unsupported compression format: '${compressionFormat}'`);
22
25
  }
23
26
  }
24
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.5.21",
3
+ "version": "0.5.22-rc-20240814161624-cedbcd0dabfe3f85518af06aa23351ec7ee8ef53",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
@@ -1,5 +1,6 @@
1
1
  import { PonyfillTransformStream } from './TransformStream.cjs';
2
2
  export type PonyfillCompressionFormat = 'x-gzip' | 'gzip' | 'x-deflate' | 'deflate' | 'deflate-raw' | 'br';
3
3
  export declare class PonyfillCompressionStream extends PonyfillTransformStream implements CompressionStream {
4
+ static supportedFormats: PonyfillCompressionFormat[];
4
5
  constructor(compressionFormat: PonyfillCompressionFormat);
5
6
  }
@@ -1,5 +1,6 @@
1
1
  import { PonyfillTransformStream } from './TransformStream.js';
2
2
  export type PonyfillCompressionFormat = 'x-gzip' | 'gzip' | 'x-deflate' | 'deflate' | 'deflate-raw' | 'br';
3
3
  export declare class PonyfillCompressionStream extends PonyfillTransformStream implements CompressionStream {
4
+ static supportedFormats: PonyfillCompressionFormat[];
4
5
  constructor(compressionFormat: PonyfillCompressionFormat);
5
6
  }
@@ -1,5 +1,6 @@
1
1
  import { PonyfillCompressionFormat } from './CompressionStream.cjs';
2
2
  import { PonyfillTransformStream } from './TransformStream.cjs';
3
3
  export declare class PonyfillDecompressionStream extends PonyfillTransformStream implements DecompressionStream {
4
+ static supportedFormats: PonyfillCompressionFormat[];
4
5
  constructor(compressionFormat: PonyfillCompressionFormat);
5
6
  }
@@ -1,5 +1,6 @@
1
1
  import { PonyfillCompressionFormat } from './CompressionStream.js';
2
2
  import { PonyfillTransformStream } from './TransformStream.js';
3
3
  export declare class PonyfillDecompressionStream extends PonyfillTransformStream implements DecompressionStream {
4
+ static supportedFormats: PonyfillCompressionFormat[];
4
5
  constructor(compressionFormat: PonyfillCompressionFormat);
5
6
  }