Opal-Estate-Pro/node_modules/gulp-add-src/index.js
2019-09-13 11:27:52 +07:00

28 lines
783 B
JavaScript

/* gulp-add-src / v1.0.0 / (c) 2014 Uri Shaked / MIT Licence */
'use strict';
var through = require('through2');
var streamqueue = require('streamqueue');
var es = require('event-stream');
var vinyl = require('vinyl-fs');
function prepend() {
var pass = through.obj();
return es.duplex(pass, streamqueue({ objectMode: true }, vinyl.src.apply(vinyl.src, arguments), pass));
}
function append() {
var pass = through.obj();
return es.duplex(pass, streamqueue({ objectMode: true }, pass, vinyl.src.apply(vinyl.src, arguments)));
}
var addSrc = function () {
var pass = through.obj();
return es.duplex(pass, es.merge(vinyl.src.apply(vinyl.src, arguments), pass));
};
addSrc.append = append;
addSrc.prepend = prepend;
module.exports = addSrc;