@whatwg-node/node-fetch 0.5.21-alpha-20240807235307-34ccde1b36b58ca7641e2da682eee662244a2656 → 0.5.21-alpha-20240814155933-2365ba5d093b5b9d61934ab89d7b8a0cb135d4af
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/CompressionStream.js +3 -0
- package/cjs/DecompressionStream.js +4 -1
- package/esm/CompressionStream.js +3 -0
- package/esm/DecompressionStream.js +4 -1
- package/package.json +1 -1
- package/typings/CompressionStream.d.cts +1 -0
- package/typings/CompressionStream.d.ts +1 -0
- package/typings/DecompressionStream.d.cts +1 -0
- package/typings/DecompressionStream.d.ts +1 -0
package/cjs/CompressionStream.js
CHANGED
@@ -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
|
27
|
+
throw new TypeError(`Unsupported compression format: '${compressionFormat}'`);
|
25
28
|
}
|
26
29
|
}
|
27
30
|
}
|
package/esm/CompressionStream.js
CHANGED
@@ -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
|
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-alpha-
|
3
|
+
"version": "0.5.21-alpha-20240814155933-2365ba5d093b5b9d61934ab89d7b8a0cb135d4af",
|
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
|
}
|