mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Add support for Rifts Closed
This commit is contained in:
@@ -75,7 +75,7 @@ export function parseStats(csv: string): Stats {
|
||||
.filter((entry) => !!entry)
|
||||
.map((stat) => stat.split(','));
|
||||
|
||||
if (splitCSV.length !== SKILLS.length + BH_MODES.length + CLUES.length + BOSSES.length + 3) {
|
||||
if (splitCSV.length !== SKILLS.length + BH_MODES.length + CLUES.length + BOSSES.length + 4) {
|
||||
throw Error(INVALID_FORMAT_ERROR);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ export function parseStats(csv: string): Stats {
|
||||
const [leaguePoints] = activityObjects.splice(0, 1);
|
||||
const bhObjects = activityObjects.splice(0, BH_MODES.length);
|
||||
const clueObjects = activityObjects.splice(0, CLUES.length);
|
||||
const [lastManStanding, soulWarsZeal] = activityObjects.splice(0, 2);
|
||||
const [lastManStanding, soulWarsZeal, riftsClosed] = activityObjects.splice(0, 3);
|
||||
const bossObjects = activityObjects.splice(0, BOSSES.length);
|
||||
|
||||
const skills: Skills = skillObjects.reduce<Skills>((prev, curr, index) => {
|
||||
@@ -138,6 +138,7 @@ export function parseStats(csv: string): Stats {
|
||||
bountyHunter,
|
||||
lastManStanding,
|
||||
soulWarsZeal,
|
||||
riftsClosed,
|
||||
clues,
|
||||
bosses
|
||||
};
|
||||
|
@@ -119,6 +119,7 @@ export type ActivityName =
|
||||
| 'rogueBH'
|
||||
| 'lastManStanding'
|
||||
| 'soulWarsZeal'
|
||||
| 'riftsClosed'
|
||||
| 'allClues'
|
||||
| 'beginnerClues'
|
||||
| 'easyClues'
|
||||
@@ -135,6 +136,7 @@ export interface Stats {
|
||||
bountyHunter: BH;
|
||||
lastManStanding: Activity;
|
||||
soulWarsZeal: Activity;
|
||||
riftsClosed: Activity;
|
||||
bosses: Bosses;
|
||||
}
|
||||
export type Modes = { [M in Gamemode]?: Stats };
|
||||
|
@@ -132,6 +132,7 @@ export const ACTIVITIES: ActivityName[] = [
|
||||
'masterClues',
|
||||
'lastManStanding',
|
||||
'soulWarsZeal',
|
||||
'riftsClosed',
|
||||
...BOSSES
|
||||
];
|
||||
|
||||
@@ -247,5 +248,6 @@ export const FORMATTED_BH_NAMES: FormattedBHNames = {
|
||||
export const FORMATTED_LMS = 'Last Man Standing';
|
||||
export const FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
|
||||
export const FORMATTED_LEAGUE_POINTS = 'League Points';
|
||||
export const FORMATTED_RIFTS_CLOSED = 'Rifts Closed';
|
||||
|
||||
export const INVALID_FORMAT_ERROR = 'Invalid hiscores format';
|
||||
|
Reference in New Issue
Block a user