Update dev branch #29

Merged
glazk0 merged 14 commits from main into dev 2024-11-25 21:37:01 +01:00
Showing only changes of commit 5c00cd447d - Show all commits

View file

@ -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<string, string>, puzzle) => {
const tag = puzzle.tags?.find((tag) =>
['easy', 'medium', 'hard'].includes(tag.name.toLowerCase())
);
@ -35,7 +35,7 @@
return acc;
}, {}) as Record<string, string>;
const themes = data.chapter?.puzzles?.reduce((acc, puzzle) => {
const themes = data.chapter?.puzzles?.reduce((acc: Record<string, string>, 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<Filters> = {
capture: () => ({
name,
name: name,
themeList: themeList.length ? themeList.join(',') : '',
difficultyList: difficultyList.length ? difficultyList.join(',') : ''
}),