(obj, strict = false)
| 34 | const kConstructed = 1 << 8; |
| 35 | |
| 36 | function 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 | |
| 50 | function isWritableNodeStream(obj) { |
| 51 | return !!( |
no outgoing calls
no test coverage detected
searching dependent graphs…