"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/isstream/isstream.js" (8 Mar 2017, 588 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 var stream = require('stream')
    2 
    3 
    4 function isStream (obj) {
    5   return obj instanceof stream.Stream
    6 }
    7 
    8 
    9 function isReadable (obj) {
   10   return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'
   11 }
   12 
   13 
   14 function isWritable (obj) {
   15   return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'
   16 }
   17 
   18 
   19 function isDuplex (obj) {
   20   return isReadable(obj) && isWritable(obj)
   21 }
   22 
   23 
   24 module.exports            = isStream
   25 module.exports.isReadable = isReadable
   26 module.exports.isWritable = isWritable
   27 module.exports.isDuplex   = isDuplex