| 104 | ) |
| 105 | } |
| 106 | const 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 | } |
| 115 | const isDestroyed = stream => { |
| 116 | if (!isNodeStream(stream)) return null |
| 117 | const wState = stream._writableState |