@whatwg-node/node-fetch 0.7.6-alpha-20241227034944-ae3ab11b792acef83302670c6b44a630daf4f2f1 → 0.7.6-alpha-20241227121043-44707c283ef4a4e89b42dfa0e5522e2c1b10511e
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/ReadableStream.js
CHANGED
@@ -153,7 +153,22 @@ class PonyfillReadableStream {
|
|
153
153
|
};
|
154
154
|
}
|
155
155
|
[Symbol.asyncIterator]() {
|
156
|
-
|
156
|
+
const iterator = this.readable[Symbol.asyncIterator]();
|
157
|
+
return {
|
158
|
+
next: () => iterator.next(),
|
159
|
+
return: () => {
|
160
|
+
if (!this.readable.destroyed) {
|
161
|
+
this.readable.destroy();
|
162
|
+
}
|
163
|
+
return iterator.return?.() || (0, utils_js_1.fakePromise)({ done: true, value: undefined });
|
164
|
+
},
|
165
|
+
throw: (err) => {
|
166
|
+
if (!this.readable.destroyed) {
|
167
|
+
this.readable.destroy(err);
|
168
|
+
}
|
169
|
+
return iterator.throw?.(err) || (0, utils_js_1.fakePromise)({ done: true, value: undefined });
|
170
|
+
},
|
171
|
+
};
|
157
172
|
}
|
158
173
|
tee() {
|
159
174
|
throw new Error('Not implemented');
|
package/esm/ReadableStream.js
CHANGED
@@ -150,7 +150,22 @@ export class PonyfillReadableStream {
|
|
150
150
|
};
|
151
151
|
}
|
152
152
|
[Symbol.asyncIterator]() {
|
153
|
-
|
153
|
+
const iterator = this.readable[Symbol.asyncIterator]();
|
154
|
+
return {
|
155
|
+
next: () => iterator.next(),
|
156
|
+
return: () => {
|
157
|
+
if (!this.readable.destroyed) {
|
158
|
+
this.readable.destroy();
|
159
|
+
}
|
160
|
+
return iterator.return?.() || fakePromise({ done: true, value: undefined });
|
161
|
+
},
|
162
|
+
throw: (err) => {
|
163
|
+
if (!this.readable.destroyed) {
|
164
|
+
this.readable.destroy(err);
|
165
|
+
}
|
166
|
+
return iterator.throw?.(err) || fakePromise({ done: true, value: undefined });
|
167
|
+
},
|
168
|
+
};
|
154
169
|
}
|
155
170
|
tee() {
|
156
171
|
throw new Error('Not implemented');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@whatwg-node/node-fetch",
|
3
|
-
"version": "0.7.6-alpha-
|
3
|
+
"version": "0.7.6-alpha-20241227121043-44707c283ef4a4e89b42dfa0e5522e2c1b10511e",
|
4
4
|
"description": "Fetch API implementation for Node",
|
5
5
|
"sideEffects": false,
|
6
6
|
"dependencies": {
|
@@ -8,7 +8,11 @@ export declare class PonyfillReadableStream<T> implements ReadableStream<T> {
|
|
8
8
|
mode: 'byob';
|
9
9
|
}): ReadableStreamBYOBReader;
|
10
10
|
getReader(): ReadableStreamDefaultReader<T>;
|
11
|
-
[Symbol.asyncIterator]():
|
11
|
+
[Symbol.asyncIterator](): {
|
12
|
+
next: () => Promise<IteratorResult<any, any>>;
|
13
|
+
return: () => Promise<IteratorResult<any, any>>;
|
14
|
+
throw: (err: Error) => Promise<IteratorResult<any, any>>;
|
15
|
+
};
|
12
16
|
tee(): [ReadableStream<T>, ReadableStream<T>];
|
13
17
|
private pipeToWriter;
|
14
18
|
pipeTo(destination: WritableStream<T>): Promise<void>;
|
@@ -8,7 +8,11 @@ export declare class PonyfillReadableStream<T> implements ReadableStream<T> {
|
|
8
8
|
mode: 'byob';
|
9
9
|
}): ReadableStreamBYOBReader;
|
10
10
|
getReader(): ReadableStreamDefaultReader<T>;
|
11
|
-
[Symbol.asyncIterator]():
|
11
|
+
[Symbol.asyncIterator](): {
|
12
|
+
next: () => Promise<IteratorResult<any, any>>;
|
13
|
+
return: () => Promise<IteratorResult<any, any>>;
|
14
|
+
throw: (err: Error) => Promise<IteratorResult<any, any>>;
|
15
|
+
};
|
12
16
|
tee(): [ReadableStream<T>, ReadableStream<T>];
|
13
17
|
private pipeToWriter;
|
14
18
|
pipeTo(destination: WritableStream<T>): Promise<void>;
|