Files
30-seconds-of-code/test/isWritableStream/isWritableStream.js
2018-10-03 22:16:10 +03:00

8 lines
230 B
JavaScript

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