source: frontend/node_modules/is-stream/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 677 bytes
Line 
1'use strict';
2
3const isStream = stream =>
4 stream !== null &&
5 typeof stream === 'object' &&
6 typeof stream.pipe === 'function';
7
8isStream.writable = stream =>
9 isStream(stream) &&
10 stream.writable !== false &&
11 typeof stream._write === 'function' &&
12 typeof stream._writableState === 'object';
13
14isStream.readable = stream =>
15 isStream(stream) &&
16 stream.readable !== false &&
17 typeof stream._read === 'function' &&
18 typeof stream._readableState === 'object';
19
20isStream.duplex = stream =>
21 isStream.writable(stream) &&
22 isStream.readable(stream);
23
24isStream.transform = stream =>
25 isStream.duplex(stream) &&
26 typeof stream._transform === 'function';
27
28module.exports = isStream;
Note: See TracBrowser for help on using the repository browser.