simdjson in JeopardyScrape

This commit is contained in:
lilyissillyyy
2025-09-14 18:42:07 -04:00
parent 441cdce540
commit 3686b54b0d
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
const request = require('node-superfetch');
const cheerio = require('cheerio');
const fs = require('fs');
const simdjson = require('simdjson');
const path = require('path');
const { checkFileExists } = require('../util/Util');
const rounds = ['jeopardy_round', 'double_jeopardy_round', 'final_jeopardy_round'];
@@ -66,7 +67,7 @@ module.exports = class JeopardyScrape {
async importData() {
const read = await fs.promises.readFile(path.join(__dirname, '..', 'jeopardy.json'), { encoding: 'utf8' });
const file = JSON.parse(read);
const file = simdjson.parse(read);
if (typeof file !== 'object' || Array.isArray(file)) return null;
if (!file.clues || !file.gameIDs || !file.seasons) return null;
for (const season of file.seasons) {