Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (file.isNull()) {
return callback(null, file);
}
if (file.isBuffer()) {
hercule.transcludeString(file.contents.toString(encoding), options, function(err, output) {
if (err) {
return callback(err, null)
}
file.contents = new Buffer(output);
return callback(null, file);
})
}
if (file.isStream()) {
var transcluder = new hercule.TranscludeStream(options);
file.contents = file.contents.pipe(transcluder);
return callback(null, file);
}
});
};
return through.obj( function(file, encoding, callback) {
if (file.isNull()) {
return callback(null, file);
}
if (file.isBuffer()) {
hercule.transcludeString(file.contents.toString(encoding), options, function(err, output) {
if (err) {
return callback(err, null)
}
file.contents = new Buffer(output);
return callback(null, file);
})
}
if (file.isStream()) {
var transcluder = new hercule.TranscludeStream(options);
file.contents = file.contents.pipe(transcluder);
return callback(null, file);
}
});
};