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

Function isNodeStream

lib/helper.js:106–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 )
105}
106const isNodeStream = obj => {
107 return (
108 obj &&
109 (obj._readableState ||
110 obj._writableState ||
111 (typeof obj.write === 'function' && typeof obj.on === 'function') ||
112 (typeof obj.pipe === 'function' && typeof obj.on === 'function'))
113 )
114}
115const isDestroyed = stream => {
116 if (!isNodeStream(stream)) return null
117 const wState = stream._writableState

Callers 1

isDestroyedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected