Files
30-seconds-of-code/test/isDuplexStream/isDuplexStream.js
2018-10-03 20:17:00 +00:00

10 lines
307 B
JavaScript

const isDuplexStream = val =>
val !== null &&
typeof val === 'object' &&
typeof val.pipe === 'function' &&
typeof val._read === 'function' &&
typeof val._readableState === 'object' &&
typeof val._write === 'function' &&
typeof val._writableState === 'object';
module.exports = isDuplexStream;