aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/skills.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/cleaners/skyblock/skills.ts')
-rw-r--r--src/cleaners/skyblock/skills.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cleaners/skyblock/skills.ts b/src/cleaners/skyblock/skills.ts
new file mode 100644
index 0000000..e283379
--- /dev/null
+++ b/src/cleaners/skyblock/skills.ts
@@ -0,0 +1,19 @@
+export interface Skill {
+ name: string
+ xp: number
+}
+
+export function cleanSkills(data: any): Skill[] {
+ const skills: Skill[] = []
+ for (const item in data) {
+ if (item.startsWith('experience_skill_')) {
+ const skillName = item.substr('experience_skill_'.length)
+ const skillValue = data[item]
+ skills.push({
+ name: skillName,
+ xp: skillValue
+ })
+ }
+ }
+ return skills
+}