Initial site commit

This commit is contained in:
Jocelyn Badgley (Twipped)
2020-02-20 14:38:25 -08:00
parent 0a6bdb2544
commit 1c45fdaf33
136 changed files with 24538 additions and 146 deletions

32
gulp/lib/debug.js Normal file
View File

@@ -0,0 +1,32 @@
const through = require('./through');
const log = require('fancy-log');
const { get } = require('lodash');
module.exports = exports = function debug (...targets) {
return through(async (stream, file) => {
var data;
const { path, relative, base, basename, extname } = file;
if (targets.length === 1 && Array.isArray(targets[0])) {
targets = targets[0];
}
if (targets.length) {
data = targets.reduce((result, target) => {
if (target === 'contents') {
result.contents = file.contents.toString();
return result;
}
result[target] = get(file, target);
return result;
}, {});
} else {
data = { ...file, path, relative, base, basename, extname };
}
log(data);
stream.push(file);
});
};