diff options
Diffstat (limited to 'src/cleaners/skyblock/objectives.ts')
-rw-r--r-- | src/cleaners/skyblock/objectives.ts | 17 |
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 +} |