--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
37
node_modules/gulp-clone/index.js
generated
vendored
Normal file
37
node_modules/gulp-clone/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
var through = require('through2'),
|
||||
gutil = require('gulp-util');
|
||||
|
||||
var cloneStream = function() {
|
||||
return through.obj(function(file, enc, cb) {
|
||||
cb(null, file.clone());
|
||||
});
|
||||
};
|
||||
|
||||
var cloneSink = function() {
|
||||
var tapStream = through.obj();
|
||||
|
||||
var stream = through.obj(function(file, enc, cb) {
|
||||
if (file.isStream()) {
|
||||
this.emit('error', new gutil.PluginError('gulp-clone', 'Streaming not supported'));
|
||||
return cb();
|
||||
}
|
||||
|
||||
if (file.isNull()) {
|
||||
return cb(null, file); // Do nothing if no contents
|
||||
}
|
||||
|
||||
tapStream.write(file.clone());
|
||||
cb(null, file);
|
||||
});
|
||||
|
||||
stream.tap = function() {
|
||||
return tapStream;
|
||||
};
|
||||
|
||||
return stream;
|
||||
};
|
||||
|
||||
module.exports = cloneStream;
|
||||
module.exports.sink = cloneSink;
|
||||
Loading…
Reference in a new issue