aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/skills.ts
blob: e2833794c5c2cffb1ff20e2ae1ab6e36b468d8cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
}