aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/objectives.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/cleaners/skyblock/objectives.ts')
-rw-r--r--src/cleaners/skyblock/objectives.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cleaners/skyblock/objectives.ts b/src/cleaners/skyblock/objectives.ts
new file mode 100644
index 0000000..3427f1f
--- /dev/null
+++ b/src/cleaners/skyblock/objectives.ts
@@ -0,0 +1,17 @@
+export interface Objective {
+ name: string
+ completed: boolean
+}
+
+export function cleanObjectives(data: any): Objective[] {
+ const rawObjectives = data?.objectives || {}
+ const objectives: Objective[] = []
+ for (const rawObjectiveName in rawObjectives) {
+ const rawObjectiveValue = rawObjectives[rawObjectiveName]
+ objectives.push({
+ name: rawObjectiveName,
+ completed: rawObjectiveValue.status === 'COMPLETE',
+ })
+ }
+ return objectives
+}