MCPcopy Create free account
hub / github.com/Maccoder3/MAC-MD / isReadableStream

Function isReadableStream

lib/helper.js:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 return !!(rState.endEmitted || (strict === false && rState.ended === true && rState.length === 0))
128}
129const isReadableStream = stream => {
130 if (typeof Stream.isReadable === 'function') return Stream.isReadable(stream)
131 if (stream && stream[kIsReadable] != null) return stream[kIsReadable]
132 if (typeof stream?.readable !== 'boolean') return null
133 if (isDestroyed(stream)) return false
134 return (
135 (isReadableNodeStream(stream) && !!stream.readable && !isReadableFinished(stream)) ||
136 stream instanceof fs.ReadStream ||
137 stream instanceof Readable
138 )
139}
140
141export default {
142 __filename,

Callers

nothing calls this directly

Calls 3

isDestroyedFunction · 0.85
isReadableNodeStreamFunction · 0.85
isReadableFinishedFunction · 0.85

Tested by

no test coverage detected