Fix csv parsing, tests.

This commit is contained in:
maxswa
2025-02-24 19:03:56 -05:00
parent b3fc5846f3
commit 99fc97f05e
3 changed files with 13 additions and 5 deletions

View File

@@ -14,7 +14,7 @@
58378,99,14103220 58378,99,14103220
13188,99,16573909 13188,99,16573909
36283,99,15061037 36283,99,15061037
17138,99,14670565 17137,99,14670565
8751,99,16169665 8751,99,16169665
60803,99,14390315 60803,99,14390315
1718,99,57850681 1718,99,57850681
@@ -90,7 +90,7 @@
113862,201 113862,201
1969,538 1969,538
12346,671 12346,671
5608,149 5606,149
550,2450 550,2450
25557,310 25557,310
1391,538 1391,538
@@ -103,6 +103,6 @@
287,7096 287,7096
97368,51 97368,51
15591,2780 15591,2780
1000407,67 1000405,67
213696,25 213696,25
240082,340 240082,340
Can't render this file because it has a wrong number of fields in line 25.

View File

@@ -227,8 +227,14 @@ export function parseStats(csv: string): Stats {
const [leaguePoints, deadmanPoints] = activityObjects.splice(0, 2); const [leaguePoints, deadmanPoints] = activityObjects.splice(0, 2);
const bhObjects = activityObjects.splice(0, BH_MODES.length); const bhObjects = activityObjects.splice(0, BH_MODES.length);
const clueObjects = activityObjects.splice(0, CLUES.length); const clueObjects = activityObjects.splice(0, CLUES.length);
const [lastManStanding, pvpArena, soulWarsZeal, riftsClosed, colosseumGlory, collectionsLogged] = const [
activityObjects.splice(0, 6); lastManStanding,
pvpArena,
soulWarsZeal,
riftsClosed,
colosseumGlory,
collectionsLogged
] = activityObjects.splice(0, 6);
const bossObjects = activityObjects.splice(0, BOSSES.length); const bossObjects = activityObjects.splice(0, BOSSES.length);
const skills: Skills = skillObjects.reduce<Skills>((prev, curr, index) => { const skills: Skills = skillObjects.reduce<Skills>((prev, curr, index) => {

View File

@@ -123,6 +123,7 @@ export const BOSSES: Boss[] = [
'corruptedGauntlet', 'corruptedGauntlet',
'hueycoatl', 'hueycoatl',
'leviathan', 'leviathan',
'royalTitans',
'whisperer', 'whisperer',
'theatreOfBlood', 'theatreOfBlood',
'theatreOfBloodHardMode', 'theatreOfBloodHardMode',
@@ -158,6 +159,7 @@ export const ACTIVITIES: ActivityName[] = [
'soulWarsZeal', 'soulWarsZeal',
'riftsClosed', 'riftsClosed',
'colosseumGlory', 'colosseumGlory',
'collectionsLogged',
...BOSSES ...BOSSES
]; ];