diff options
author | mat-1 <github@matdoes.dev> | 2021-03-01 02:00:33 +0000 |
---|---|---|
committer | mat-1 <github@matdoes.dev> | 2021-03-01 02:00:33 +0000 |
commit | aff515fb49f56267a6981f423fc14c1712b106eb (patch) | |
tree | 6cfe1ca16fe44a6557f155f0649ce4570148ecd4 | |
parent | f4a61c7ad89ac1da1c3828cab9893e5b9bc55f73 (diff) | |
download | skyblock-api-aff515fb49f56267a6981f423fc14c1712b106eb.tar.gz skyblock-api-aff515fb49f56267a6981f423fc14c1712b106eb.tar.bz2 skyblock-api-aff515fb49f56267a6981f423fc14c1712b106eb.zip |
Compiled TS into JS
-rw-r--r-- | build/database.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/build/database.js b/build/database.js index 208c56a..e7f7385 100644 --- a/build/database.js +++ b/build/database.js @@ -78,14 +78,12 @@ function getMemberLeaderboardAttributes(member) { } async function fetchAllLeaderboardsCategoriezed() { const memberLeaderboardAttributes = await fetchAllMemberLeaderboardAttributes(); - const categorizedLeaderboards = []; + const categorizedLeaderboards = {}; for (const leaderboard of memberLeaderboardAttributes) { - const { category, name } = stats_1.categorizeStat(leaderboard); - categorizedLeaderboards.push({ - category, - name, - id: leaderboard - }); + const { category } = stats_1.categorizeStat(leaderboard); + if (!categorizedLeaderboards[category]) + categorizedLeaderboards[category] = []; + categorizedLeaderboards[category].push(leaderboard); } return categorizedLeaderboards; } |