aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-02-13 19:02:49 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-02-13 19:02:49 -0600
commit9b2856303374521b315759500cf594ec7f22d293 (patch)
treef1439e79f6b79ac2f32cfa08e58124bff553b502 /src/cleaners/skyblock
parent728994f435e781eeffcba739698a1c21bba76a83 (diff)
downloadskyblock-api-9b2856303374521b315759500cf594ec7f22d293.tar.gz
skyblock-api-9b2856303374521b315759500cf594ec7f22d293.tar.bz2
skyblock-api-9b2856303374521b315759500cf594ec7f22d293.zip
fix some stats cutting off at the wrong place
Diffstat (limited to 'src/cleaners/skyblock')
-rw-r--r--src/cleaners/skyblock/stats.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts
index c4ff545..1222582 100644
--- a/src/cleaners/skyblock/stats.ts
+++ b/src/cleaners/skyblock/stats.ts
@@ -26,8 +26,8 @@ function categorizeStat(statNameRaw: string): statCategory {
}
for (const categoryMatch of statCategoryMatchers) {
// ['deaths_']
- let trailingEnd = categoryMatch[0] == '_'
- let trailingStart = categoryMatch.substr(-1) == '_'
+ let trailingEnd = categoryMatch[0] === '_'
+ let trailingStart = categoryMatch.substr(-1) === '_'
if (trailingStart && statNameRaw.startsWith(categoryMatch)) {
return {
category: statCategory,
@@ -36,7 +36,7 @@ function categorizeStat(statNameRaw: string): statCategory {
} else if (trailingEnd && statNameRaw.endsWith(categoryMatch)) {
return {
category: statCategory,
- name: statNameRaw.substr(0, categoryMatch.length)
+ name: statNameRaw.substr(0, statNameRaw.length - categoryMatch.length)
}
} else if (statNameRaw == categoryMatch) {
// if it matches exactly, we don't know the name. will be defaulted to category later on