mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix lint
This commit is contained in:
@@ -76,15 +76,15 @@ module.exports = class JeopardyScrape {
|
|||||||
this.seasons = seasons;
|
this.seasons = seasons;
|
||||||
this.clues = await this.importClues();
|
this.clues = await this.importClues();
|
||||||
this.imported = true;
|
this.imported = true;
|
||||||
return file;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
importClues() {
|
importClues() {
|
||||||
const pipeline = fs.createReadStream(path.join(__dirname, '..', 'jeopardy.json'), { encoding: 'utf8'})
|
const pipeline = fs.createReadStream(path.join(__dirname, '..', 'jeopardy.json'), { encoding: 'utf8' })
|
||||||
.pipe(parser())
|
.pipe(parser())
|
||||||
.pipe(pick({ filter: 'clues' }))
|
.pipe(pick({ filter: 'clues' }))
|
||||||
.pipe(streamArray());
|
.pipe(streamArray());
|
||||||
pipeline.on('data', ({ key, value }) => this.clues.push(value));
|
pipeline.on('data', ({ value }) => this.clues.push(value));
|
||||||
return new Promise(res => {
|
return new Promise(res => {
|
||||||
pipeline.on('end', () => res(this.clues));
|
pipeline.on('end', () => res(this.clues));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user