forked from github.com/GenderDysphoria.fyi
Burn it down and rise from the ashes
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
|
||||
const through = require('./through');
|
||||
const fs = require('fs-extra');
|
||||
const log = require('fancy-log');
|
||||
const parallelize = require('concurrent-transform');
|
||||
|
||||
module.exports = exports = function load () {
|
||||
return parallelize(through(async (stream, file) => {
|
||||
|
||||
if (file.contents) {
|
||||
// file already has contents, ignore
|
||||
stream.push(file);
|
||||
return;
|
||||
}
|
||||
|
||||
const exists = await fs.pathExists(file.path);
|
||||
// if (!exists) return;
|
||||
|
||||
log('[loading]', file.path, exists);
|
||||
|
||||
file.contents = await fs.readFile(file.path);
|
||||
|
||||
stream.push(file);
|
||||
}), 20);
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ var entityProcessors = {
|
||||
};
|
||||
|
||||
module.exports = exports = function (tweets) {
|
||||
return Array.isArray(tweets) ? tweets.map(parseTweet) : parseTweet(tweets);
|
||||
return tweets.length ? tweets.map(parseTweet) : parseTweet(tweets);
|
||||
|
||||
function parseTweet (tweet) {
|
||||
// clone the tweet so we're not altering the original
|
||||
|
||||
Reference in New Issue
Block a user