ee09d9c52defe053f2dd321a8a22849496392912fb2920a98a8205f39e732f3426562c4196625d1a90d019616d98cc4adfd9f15be0992f020e574cb6e13a58 677 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. const isStream = stream =>
  3. stream !== null &&
  4. typeof stream === 'object' &&
  5. typeof stream.pipe === 'function';
  6. isStream.writable = stream =>
  7. isStream(stream) &&
  8. stream.writable !== false &&
  9. typeof stream._write === 'function' &&
  10. typeof stream._writableState === 'object';
  11. isStream.readable = stream =>
  12. isStream(stream) &&
  13. stream.readable !== false &&
  14. typeof stream._read === 'function' &&
  15. typeof stream._readableState === 'object';
  16. isStream.duplex = stream =>
  17. isStream.writable(stream) &&
  18. isStream.readable(stream);
  19. isStream.transform = stream =>
  20. isStream.duplex(stream) &&
  21. typeof stream._transform === 'function';
  22. module.exports = isStream;