diff options
author | mat <github@matdoes.dev> | 2021-06-03 16:46:23 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2021-06-03 16:46:23 -0500 |
commit | 134abd6cca8827ce7a7803a64f4d11a18000c038 (patch) | |
tree | 55d23c63d0e4461674ce1958708605234283935d /src/cleaners/skyblock/collections.ts | |
parent | 7caf789818a3463df27e441a8c5dd5a47798ac81 (diff) | |
download | skyblock-api-134abd6cca8827ce7a7803a64f4d11a18000c038.tar.gz skyblock-api-134abd6cca8827ce7a7803a64f4d11a18000c038.tar.bz2 skyblock-api-134abd6cca8827ce7a7803a64f4d11a18000c038.zip |
change some variable names in collections to make more sense
Diffstat (limited to 'src/cleaners/skyblock/collections.ts')
-rw-r--r-- | src/cleaners/skyblock/collections.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cleaners/skyblock/collections.ts b/src/cleaners/skyblock/collections.ts index a3e1fb3..708822b 100644 --- a/src/cleaners/skyblock/collections.ts +++ b/src/cleaners/skyblock/collections.ts @@ -111,23 +111,23 @@ export function cleanCollections(data: any): Collection[] { // collection names show up like this: { LOG: 49789, LOG:2: 26219, MUSHROOM_COLLECTION: 2923} // these values are different for each player in a coop - const playerCollectionValuesRaw: { [ key in hypixelItemNames ]: number } = data?.collection ?? {} - const playerCollectionValues: Collection[] = [] + const playerCollectionXpsRaw: { [ key in hypixelItemNames ]: number } = data?.collection ?? {} + const playerCollections: Collection[] = [] - for (const collectionNameRaw in playerCollectionValuesRaw) { - const collectionValue: number = playerCollectionValuesRaw[collectionNameRaw] + for (const collectionNameRaw in playerCollectionXpsRaw) { + const collectionXp: number = playerCollectionXpsRaw[collectionNameRaw] const collectionName = cleanItemId(collectionNameRaw) const collectionLevel = playerCollectionTiers[collectionName] const collectionCategory = getCategory(collectionName) ?? 'unknown' // in some very weird cases the collection level will be undefined, we should ignore these collections if (collectionLevel !== undefined) - playerCollectionValues.push({ + playerCollections.push({ name: collectionName, - xp: collectionValue, + xp: collectionXp, level: collectionLevel, category: collectionCategory }) } - return playerCollectionValues + return playerCollections }
\ No newline at end of file |