We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 845b8c3 commit 1c1d894Copy full SHA for 1c1d894
src/http.js
@@ -263,15 +263,13 @@ const ndjson = async function * (source) {
263
const streamToAsyncIterator = function (source) {
264
if (isAsyncIterator(source)) {
265
// Workaround for https://github.com/node-fetch/node-fetch/issues/766
266
- if (source.writable && source.readable) {
+ if (Object.prototype.hasOwnProperty.call(source, 'readable') && Object.prototype.hasOwnProperty.call(source, 'writable')) {
267
const iter = source[Symbol.asyncIterator]()
268
269
const wrapper = {
270
next: iter.next.bind(iter),
271
return: () => {
272
- if (source.writableEnded) {
273
- source.destroy()
274
- }
+ source.destroy()
275
276
return iter.return()
277
},
0 commit comments