MCPcopy Index your code
hub / github.com/nodejs/node / isReadableNodeStream

Function isReadableNodeStream

lib/internal/streams/utils.js:36–48  ·  view source on GitHub ↗
(obj, strict = false)

Source from the content-addressed store, hash-verified

34const kConstructed = 1 << 8;
35
36function isReadableNodeStream(obj, strict = false) {
37 return !!(
38 obj &&
39 typeof obj.pipe === 'function' &&
40 typeof obj.on === 'function' &&
41 (
42 !strict ||
43 (typeof obj.pause === 'function' && typeof obj.resume === 'function')
44 ) &&
45 (!obj._writableState || obj._readableState?.readable !== false) && // Duplex
46 (!obj._writableState || obj._readableState) // Writable has .pipe.
47 );
48}
49
50function isWritableNodeStream(obj) {
51 return !!(

Callers 8

isReadableEndedFunction · 0.85
isReadableFinishedFunction · 0.85
isReadableFunction · 0.85
makeAsyncIterableFunction · 0.85
pipelineImplFunction · 0.85
duplexify.jsFile · 0.85
getEosOnCloseErrorFunction · 0.85
eosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…