aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-05-26 18:49:01 -0500
committermat <github@matdoes.dev>2021-05-26 18:49:01 -0500
commita3662fb5888bd031b27cc81028ba86b0271eb442 (patch)
tree8502152ccc8531876b0dd6c5a93c243fa9198560 /src
parent98055cbba8c0106e87b6488bb1f014139e90eae8 (diff)
downloadskyblock-api-a3662fb5888bd031b27cc81028ba86b0271eb442.tar.gz
skyblock-api-a3662fb5888bd031b27cc81028ba86b0271eb442.tar.bz2
skyblock-api-a3662fb5888bd031b27cc81028ba86b0271eb442.zip
replace a rank thing with switch statement
Diffstat (limited to 'src')
-rw-r--r--src/cleaners/rank.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/cleaners/rank.ts b/src/cleaners/rank.ts
index ec55e8b..997888c 100644
--- a/src/cleaners/rank.ts
+++ b/src/cleaners/rank.ts
@@ -47,11 +47,21 @@ export function cleanRank({
?? packageRank?.replace('_PLUS', '+')
// MVP++ is called Superstar for some reason
- if (name === 'SUPERSTAR') name = 'MVP++'
- // YouTube rank is called YouTuber, change this to the proper name
- else if (name === 'YOUTUBER') name = 'YOUTUBE'
- else if (name === 'GAME_MASTER') name = 'GM'
- else if (name === undefined) name = 'NONE'
+ switch (name) {
+ case 'SUPERSTAR':
+ name = 'MVP++'
+ break
+ // YouTube rank is called YouTuber, change this to the proper name
+ case 'YOUTUBER':
+ name = 'YOUTUBE'
+ break
+ case 'GAME_MASTER':
+ name = 'GM'
+ break
+ case undefined:
+ name = 'NONE'
+ break
+ }
const plusColor = rankPlusColor ? colorCodeFromName(rankPlusColor) : null
color = minecraftColorCodes[rankColors[name]]