i accidentally the eslint

This commit is contained in:
zkldi
2021-08-10 04:28:43 +01:00
parent d962de5735
commit a57245f373
45 changed files with 1225 additions and 1240 deletions
+15 -15
View File
@@ -7,25 +7,25 @@ const charts = JSON.parse(fs.readFileSync(path.join(__dirname, "charts.json"), "
const map: Map<string, any> = new Map();
for (const chart of charts) {
const id = `${chart.songID}-${chart.difficulty}`;
const doc = map.get(id);
const id = `${chart.songID}-${chart.difficulty}`;
const doc = map.get(id);
if (doc) {
if (Array.isArray(doc.data.hashSHA1)) {
doc.data.hashSHA1.push(chart.data.hashSHA1);
} else {
doc.data.hashSHA1 = [doc.data.hashSHA1, chart.data.hashSHA1];
}
if (doc) {
if (Array.isArray(doc.data.hashSHA1)) {
doc.data.hashSHA1.push(chart.data.hashSHA1);
} else {
doc.data.hashSHA1 = [doc.data.hashSHA1, chart.data.hashSHA1];
}
// insane hack
chart.erasethis = true;
} else {
map.set(id, chart);
}
// insane hack
chart.erasethis = true;
} else {
map.set(id, chart);
}
}
// works because byref
fs.writeFileSync(
path.join(__dirname, "deduped-charts.json"),
JSON.stringify(charts.filter((e: any) => e.erasethis !== true))
path.join(__dirname, "deduped-charts.json"),
JSON.stringify(charts.filter((e: any) => e.erasethis !== true))
);
+4 -4
View File
@@ -6,8 +6,8 @@ const songs = JSON.parse(fs.readFileSync(path.join(__dirname, "songs.json"), "ut
const charts = JSON.parse(fs.readFileSync(path.join(__dirname, "deduped-charts.json"), "utf-8"));
(async () => {
await db.songs.usc.remove({});
await db.charts.usc.remove({});
await db.songs.usc.insert(songs);
await db.charts.usc.insert(charts);
await db.songs.usc.remove({});
await db.charts.usc.remove({});
await db.songs.usc.insert(songs);
await db.charts.usc.insert(charts);
})();