Skip to content

Commit

Permalink
fix: strengthen isStream condition checking (nodejs#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
debadree25 authored and crysmags committed Feb 27, 2024
1 parent f92268a commit 2fed27a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(
function nop () {}

function isStream (obj) {
return obj && typeof obj.pipe === 'function'
return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
}

// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
Expand Down

0 comments on commit 2fed27a

Please sign in to comment.