diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/gulp-stream/index.js | |
parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) |
remove node_modules
Diffstat (limited to 'node_modules/gulp-stream/index.js')
-rw-r--r-- | node_modules/gulp-stream/index.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/node_modules/gulp-stream/index.js b/node_modules/gulp-stream/index.js deleted file mode 100644 index 5c3f1ece0..000000000 --- a/node_modules/gulp-stream/index.js +++ /dev/null @@ -1,50 +0,0 @@ -var through = require('through2'); -var Stream = require('stream'); - -// Consts -const PLUGIN_NAME = 'gulp-stream'; - -function gulpStream() { - var stream = through.obj(function(file, enc, callback) { - - // keep null files as-is - if (file.isNull()) { - this.push(file); - return callback(); - } - - // keep stream files as-is - if (file.isStream()) { - this.push(file); - return callback(); - } - - // transform buffer files into buffers - if (file.isBuffer()) { - var cstream = Readable(file.contents); - cstream.on('error', this.emit.bind(this, 'error')); - file.contents = cstream; - this.push(file); - return callback(); - } - - }); - - return stream; -}; - -function Readable(buffer){ - var readable = new Stream.Readable(); - var idx = 0; - readable._read = function(size) { - var chunk = buffer.slice(0, size); - buffer = buffer.slice(size); - var finished = (chunk.length == 0 && buffer.length == 0); - this.push(finished ? null : chunk); - }; - return readable; -} - - - -module.exports = gulpStream; |