Skip to content

Commit

Permalink
fix: strengthen isStream condition checking (#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
debadree25 committed Feb 23, 2023
1 parent 236df29 commit e461407
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 e461407

Please sign in to comment.