diff options
author | mat <github@matdoes.dev> | 2022-04-09 19:18:18 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-04-09 19:18:18 -0500 |
commit | 44510a2390270c7aeb8ad7ade72cd03c56ad5a2d (patch) | |
tree | cc76ae594bb67aa9f79e29f4e5114d101ef2450b /src/cleaners | |
parent | 751b207c86c1e9bea14d48c0855fce5b62ddaba3 (diff) | |
download | skyblock-api-44510a2390270c7aeb8ad7ade72cd03c56ad5a2d.tar.gz skyblock-api-44510a2390270c7aeb8ad7ade72cd03c56ad5a2d.tar.bz2 skyblock-api-44510a2390270c7aeb8ad7ade72cd03c56ad5a2d.zip |
Year 200 century cake & update test data
Diffstat (limited to 'src/cleaners')
-rw-r--r-- | src/cleaners/skyblock/claimed.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cleaners/skyblock/claimed.ts b/src/cleaners/skyblock/claimed.ts index 3a4631e..f30dedf 100644 --- a/src/cleaners/skyblock/claimed.ts +++ b/src/cleaners/skyblock/claimed.ts @@ -15,11 +15,16 @@ export function cleanPlayerSkyblockClaimed(data: typedHypixelApi.PlayerDataRespo name: 'potato_talisman', timestamp: data.claimed_potato_talisman }) - if (data.claimed_century_cake) + + const centuryCakes = Object.keys(data).filter((key) => key.startsWith('claimed_century_cake')) + for (const centuryCake of centuryCakes) { + const centuryCakeYear = centuryCake === 'claimed_century_cake' ? '100' : centuryCakes.slice('claimed_century_cake'.length) claimedItems.push({ - name: 'century_cake', - timestamp: data.claimed_century_cake + name: `year_${centuryCakeYear}_century_cake`, + timestamp: data[centuryCake] }) + } + if (data.claimed_year143_cake) claimedItems.push({ name: 'year_143_cake', |