@whatwg-node/node-fetch
Advanced tools
Comparing version 0.7.6-alpha-20241227034944-ae3ab11b792acef83302670c6b44a630daf4f2f1 to 0.7.6-alpha-20241227115757-23fb6bdf701277c1ef33a7bffb0ea3502aca43da
@@ -156,3 +156,18 @@ "use strict"; | ||
[Symbol.asyncIterator]() { | ||
return this.readable[Symbol.asyncIterator](); | ||
const iterator = this.readable[Symbol.asyncIterator](); | ||
return { | ||
next: () => iterator.next(), | ||
return: () => { | ||
if (!this.readable.destroyed) { | ||
this.readable.destroy(); | ||
} | ||
return iterator.return?.() || (0, utils_js_1.fakePromise)({ done: true, value: undefined }); | ||
}, | ||
throw: (err) => { | ||
if (!this.readable.destroyed) { | ||
this.readable.destroy(err); | ||
} | ||
return iterator.throw?.(err) || (0, utils_js_1.fakePromise)({ done: true, value: undefined }); | ||
}, | ||
}; | ||
} | ||
@@ -159,0 +174,0 @@ tee() { |
@@ -153,3 +153,18 @@ import { Readable } from 'stream'; | ||
[Symbol.asyncIterator]() { | ||
return this.readable[Symbol.asyncIterator](); | ||
const iterator = this.readable[Symbol.asyncIterator](); | ||
return { | ||
next: () => iterator.next(), | ||
return: () => { | ||
if (!this.readable.destroyed) { | ||
this.readable.destroy(); | ||
} | ||
return iterator.return?.() || fakePromise({ done: true, value: undefined }); | ||
}, | ||
throw: (err) => { | ||
if (!this.readable.destroyed) { | ||
this.readable.destroy(err); | ||
} | ||
return iterator.throw?.(err) || fakePromise({ done: true, value: undefined }); | ||
}, | ||
}; | ||
} | ||
@@ -156,0 +171,0 @@ tee() { |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.7.6-alpha-20241227034944-ae3ab11b792acef83302670c6b44a630daf4f2f1", | ||
"version": "0.7.6-alpha-20241227115757-23fb6bdf701277c1ef33a7bffb0ea3502aca43da", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -11,3 +11,7 @@ import { Readable } from 'stream'; | ||
getReader(): ReadableStreamDefaultReader<T>; | ||
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any, any, any>; | ||
[Symbol.asyncIterator](): { | ||
next: () => Promise<IteratorResult<any, any>>; | ||
return: () => Promise<IteratorResult<any, any>>; | ||
throw: (err: Error) => Promise<IteratorResult<any, any>>; | ||
}; | ||
tee(): [ReadableStream<T>, ReadableStream<T>]; | ||
@@ -14,0 +18,0 @@ private pipeToWriter; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237158
6014