mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-11-25 20:42:40 +00:00
Initial site commit
This commit is contained in:
19
gulp/lib/through.js
Normal file
19
gulp/lib/through.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
const log = require('fancy-log');
|
||||
var through = require('through2');
|
||||
|
||||
module.exports = exports = function asyncthrough (...args) {
|
||||
const [ fn, donefn ] = args;
|
||||
|
||||
args[0] = function (file, enc, next) {
|
||||
fn(this, file, enc).then(() => next(), (err) => { log.error(err, 'Error thrown'); next(err); });
|
||||
};
|
||||
|
||||
if (donefn) {
|
||||
args[1] = function (next) {
|
||||
donefn(this).then(() => next(), (err) => { log.error(err, 'Error thrown'); next(err); });
|
||||
};
|
||||
}
|
||||
|
||||
return through.obj(...args);
|
||||
};
|
||||
Reference in New Issue
Block a user