aboutsummaryrefslogtreecommitdiff
path: root/node_modules/multipipe/index.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/multipipe/index.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/multipipe/index.js')
-rw-r--r--node_modules/multipipe/index.js72
1 files changed, 0 insertions, 72 deletions
diff --git a/node_modules/multipipe/index.js b/node_modules/multipipe/index.js
deleted file mode 100644
index 5e406db88..000000000
--- a/node_modules/multipipe/index.js
+++ /dev/null
@@ -1,72 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var duplexer = require('duplexer2');
-var Stream = require('stream');
-
-/**
- * Slice reference.
- */
-
-var slice = [].slice;
-
-/**
- * Duplexer options.
- */
-
-var opts = {
- bubbleErrors: false
-};
-
-/**
- * Expose `pipe`.
- */
-
-module.exports = pipe;
-
-/**
- * Pipe.
- *
- * @param {Stream,...,[Function]}
- * @return {Stream}
- * @api public
- */
-
-function pipe(){
- if (arguments.length == 1) return arguments[0];
- var streams = slice.call(arguments);
- var cb;
- if ('function' == typeof streams[streams.length - 1]) {
- cb = streams.splice(-1)[0];
- }
- var first = streams[0];
- var last = streams[streams.length - 1];
- var ret;
-
- if (first.writable && last.readable) ret = duplexer(opts, first, last);
- else if (first.writable) ret = first;
- else if (last.readable) ret = last;
- else ret = new Stream;
-
- streams.forEach(function(stream, i){
- var next = streams[i+1];
- if (next) stream.pipe(next);
- if (stream != ret) stream.on('error', ret.emit.bind(ret, 'error'));
- });
-
- if (cb) {
- var ended = false;
- ret.on('error', end);
- last.on('finish', end);
- function end(err){
- if (ended) return;
- ended = true;
- cb(err);
- }
- }
-
- return ret;
-}
-