From 5c00cd447dcf38095aa6f02484ae393d7c5865f4 Mon Sep 17 00:00:00 2001 From: glazk0 <43091603+glazk0@users.noreply.github.com> Date: Tue, 17 Sep 2024 19:14:08 +0200 Subject: [PATCH] misc: types issues --- src/routes/(app)/chapters/[chapterId=id]/+page.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/(app)/chapters/[chapterId=id]/+page.svelte b/src/routes/(app)/chapters/[chapterId=id]/+page.svelte index fbe5ec3..cf602c6 100644 --- a/src/routes/(app)/chapters/[chapterId=id]/+page.svelte +++ b/src/routes/(app)/chapters/[chapterId=id]/+page.svelte @@ -19,11 +19,11 @@ difficultyList?: string; }; - let name = ''; + let name: string = ''; let themeList: string[] = []; let difficultyList: string[] = []; - const difficulties = data.chapter?.puzzles?.reduce((acc, puzzle) => { + const difficulties = data.chapter?.puzzles?.reduce((acc: Record, puzzle) => { const tag = puzzle.tags?.find((tag) => ['easy', 'medium', 'hard'].includes(tag.name.toLowerCase()) ); @@ -35,7 +35,7 @@ return acc; }, {}) as Record; - const themes = data.chapter?.puzzles?.reduce((acc, puzzle) => { + const themes = data.chapter?.puzzles?.reduce((acc: Record, puzzle) => { puzzle.tags?.forEach((tag) => { if (!['easy', 'medium', 'hard'].includes(tag.name.toLowerCase())) { acc[tag.name] = tag.name.toLowerCase(); @@ -64,7 +64,7 @@ export const snapshot: Snapshot = { capture: () => ({ - name, + name: name, themeList: themeList.length ? themeList.join(',') : '', difficultyList: difficultyList.length ? difficultyList.join(',') : '' }),