_(readDir(linksPath)) .map(arr => arr.sort((a, b) => a.localeCompare(b))) .flatMap(arr => _(arrayMod(arr))) .flatMap(filepath => exports.fileToContent(filepath, linksPath)) .flatMap(file => exports.fileToDocuments(file))
_(readFile(filePath)).map(res => ({filename, text: res.toString()}))
_(sections) .map(section => section.replace(/\r/g, '')) .filter(section => section && section.length > 0 && section.replace(/\n/g, '').length > 0) .map(text => ({text, filename})) .flatMap(({text, filename}) => { const [, episodeName] = /\d+-\d+-(.+?)\./.exec(filename); return _(links) .filter(l => l && l.length > 0) .map(link => { const urls = extractLinks(link); const title = link