diff options
author | mat <github@matdoes.dev> | 2022-03-26 13:17:48 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-26 13:17:48 -0500 |
commit | 03537cf0cce0a19740c069c700374cafe176b3b5 (patch) | |
tree | 9ce3bd8911c04f8670b6baf504304763cd91325b /src/cleaners/skyblock/stats.ts | |
parent | 6b94d0110a52a355758432ff6cd14c80553471ea (diff) | |
download | skyblock-api-03537cf0cce0a19740c069c700374cafe176b3b5.tar.gz skyblock-api-03537cf0cce0a19740c069c700374cafe176b3b5.tar.bz2 skyblock-api-03537cf0cce0a19740c069c700374cafe176b3b5.zip |
Change a lot of things to use typed-hypixel-api
Diffstat (limited to 'src/cleaners/skyblock/stats.ts')
-rw-r--r-- | src/cleaners/skyblock/stats.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts index cce1561..645f879 100644 --- a/src/cleaners/skyblock/stats.ts +++ b/src/cleaners/skyblock/stats.ts @@ -1,4 +1,7 @@ -const statCategories: { [ key: string ]: string[] | null } = { // sorted in order of importance +import typedHypixelApi from 'typed-hypixel-api' + + +const statCategories: { [key: string]: string[] | null } = { // sorted in order of importance 'deaths': ['deaths_', 'deaths'], 'kills': ['kills_', 'kills'], 'fishing': ['items_fished_', 'items_fished', 'shredder_'], @@ -76,7 +79,7 @@ export interface StatItem { } export function getStatUnit(name: string): string | null { - for (const [ unitName, statMatchers ] of Object.entries(statUnits)) { + for (const [unitName, statMatchers] of Object.entries(statUnits)) { for (const statMatch of statMatchers) { let trailingEnd = statMatch[0] === '_' let trailingStart = statMatch.substr(-1) === '_' @@ -92,7 +95,7 @@ export function getStatUnit(name: string): string | null { } -export function cleanProfileStats(data: any): StatItem[] { +export function cleanProfileStats(data: typedHypixelApi.SkyBlockProfileMember): StatItem[] { // TODO: add type for statsRaw (probably in hypixelApi.ts since its coming from there) const stats: StatItem[] = [] |