source: trip-planner-front/node_modules/isstream/isstream.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 588 bytes
Line 
1var stream = require('stream')
2
3
4function isStream (obj) {
5 return obj instanceof stream.Stream
6}
7
8
9function isReadable (obj) {
10 return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'
11}
12
13
14function isWritable (obj) {
15 return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'
16}
17
18
19function isDuplex (obj) {
20 return isReadable(obj) && isWritable(obj)
21}
22
23
24module.exports = isStream
25module.exports.isReadable = isReadable
26module.exports.isWritable = isWritable
27module.exports.isDuplex = isDuplex
Note: See TracBrowser for help on using the repository browser.