MCPcopy Create free account
hub / github.com/nodejs/node / isStream

Function isStream

deps/undici/src/lib/core/util.js:79–81  ·  view source on GitHub ↗

* @param {*} obj * @returns {obj is import('node:stream').Stream}

(obj)

Source from the content-addressed store, hash-verified

77 * @returns {obj is import('node:stream').Stream}
78 */
79function isStream (obj) {
80 return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
81}
82
83/**
84 * @param {*} object

Callers 4

wrapRequestBodyFunction · 0.70
bodyLengthFunction · 0.70
destroyFunction · 0.70
constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected