first commit
This commit is contained in:
24
build/node_modules/vinyl-assign/index.js
generated
vendored
Normal file
24
build/node_modules/vinyl-assign/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
var objectAssign = require('object-assign');
|
||||
var Transform = require('readable-stream/transform');
|
||||
|
||||
module.exports = function (opts) {
|
||||
opts = opts || {};
|
||||
|
||||
return new Transform({
|
||||
objectMode: true,
|
||||
transform: function (file, enc, cb) {
|
||||
if (file.isNull()) {
|
||||
cb(null, file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.isStream()) {
|
||||
cb(new Error('Streaming is not supported'));
|
||||
return;
|
||||
}
|
||||
|
||||
cb(null, objectAssign(file, opts));
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user