You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
460 B
24 lines
460 B
'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)); |
|
} |
|
}); |
|
};
|
|
|