From 7935c5a5236f8e8bfaf88d8d39022fac2e7b2914 Mon Sep 17 00:00:00 2001 From: maxswa Date: Sat, 12 Aug 2023 11:19:33 -0400 Subject: [PATCH] Update name matching to use lowercase values. --- src/hiscores.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hiscores.ts b/src/hiscores.ts index 46f8524..3dadff1 100644 --- a/src/hiscores.ts +++ b/src/hiscores.ts @@ -111,7 +111,7 @@ export function parseJsonStats(json: HiscoresResponse): Stats { const getActivity = (formattedName: string): Activity => { const hiscoresActivity = json.activities.find( // We must match on name here since id is not guaranteed to be the same between updates - ({ name }) => name === formattedName + ({ name }) => name.toLowerCase() === formattedName.toLowerCase() ); return { rank: hiscoresActivity?.rank ?? -1, @@ -133,7 +133,8 @@ export function parseJsonStats(json: HiscoresResponse): Stats { const skills = SKILLS.reduce((skillsObject, skillName) => { const hiscoresSkill = json.skills.find( // We must match on name here since id is not guaranteed to be the same between updates - ({ name }) => name === FORMATTED_SKILL_NAMES[skillName] + ({ name }) => + name.toLowerCase() === FORMATTED_SKILL_NAMES[skillName].toLowerCase() ); return { ...skillsObject,