mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Update name matching to use lowercase values.
This commit is contained in:
@@ -111,7 +111,7 @@ export function parseJsonStats(json: HiscoresResponse): Stats {
|
|||||||
const getActivity = (formattedName: string): Activity => {
|
const getActivity = (formattedName: string): Activity => {
|
||||||
const hiscoresActivity = json.activities.find(
|
const hiscoresActivity = json.activities.find(
|
||||||
// We must match on name here since id is not guaranteed to be the same between updates
|
// 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 {
|
return {
|
||||||
rank: hiscoresActivity?.rank ?? -1,
|
rank: hiscoresActivity?.rank ?? -1,
|
||||||
@@ -133,7 +133,8 @@ export function parseJsonStats(json: HiscoresResponse): Stats {
|
|||||||
const skills = SKILLS.reduce<Skills>((skillsObject, skillName) => {
|
const skills = SKILLS.reduce<Skills>((skillsObject, skillName) => {
|
||||||
const hiscoresSkill = json.skills.find(
|
const hiscoresSkill = json.skills.find(
|
||||||
// We must match on name here since id is not guaranteed to be the same between updates
|
// 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 {
|
return {
|
||||||
...skillsObject,
|
...skillsObject,
|
||||||
|
Reference in New Issue
Block a user