aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/stats.ts
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-06-29 17:52:00 -0500
committerGitHub <noreply@github.com>2021-06-29 17:52:00 -0500
commitc0c534dafb54ebf9f95a5054f576ad99de29f232 (patch)
tree8a8a81f5bd6fbb372899f769be402f0bec326149 /src/cleaners/skyblock/stats.ts
parent6c7d2de36be559f62560f00fc2297c7deec3a051 (diff)
downloadskyblock-api-c0c534dafb54ebf9f95a5054f576ad99de29f232.tar.gz
skyblock-api-c0c534dafb54ebf9f95a5054f576ad99de29f232.tar.bz2
skyblock-api-c0c534dafb54ebf9f95a5054f576ad99de29f232.zip
enable strictNullChecks and fix all related issues (#65)
Diffstat (limited to 'src/cleaners/skyblock/stats.ts')
-rw-r--r--src/cleaners/skyblock/stats.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts
index 31a894c..a91ca74 100644
--- a/src/cleaners/skyblock/stats.ts
+++ b/src/cleaners/skyblock/stats.ts
@@ -14,8 +14,8 @@ const statCategories: { [ key: string ]: string[] | null } = { // sorted in orde
}
export interface StatCategory {
- category: string,
- name: string
+ category: string | null
+ name: string | null
}
export function categorizeStat(statNameRaw: string): StatCategory {
@@ -71,11 +71,11 @@ export interface StatItem {
rawName: string
value: number
categorizedName: string
- category: string
- unit: string
+ category: string | null
+ unit: string | null
}
-export function getStatUnit(name: string): string {
+export function getStatUnit(name: string): string | null {
for (const [ unitName, statMatchers ] of Object.entries(statUnits)) {
for (const statMatch of statMatchers) {
let trailingEnd = statMatch[0] === '_'
@@ -88,6 +88,7 @@ export function getStatUnit(name: string): string {
return unitName
}
}
+ return null
}