Initial commit with Sveltekit + format files

This commit is contained in:
pheralb
2025-08-21 10:26:07 +01:00
parent ca4f397e0a
commit 459457a7e1
97 changed files with 3892 additions and 9893 deletions
+9 -5
View File
@@ -1,5 +1,5 @@
import type { iSVG } from '@/types/svg';
import { svgs } from './svgs';
import type { iSVG } from "@/types/svg";
import { svgs } from "./svgs";
export const svgsData = svgs.map((svg: iSVG, index: number) => {
return { id: index, ...svg };
@@ -7,17 +7,21 @@ export const svgsData = svgs.map((svg: iSVG, index: number) => {
export const getCategories = () => {
const categories = svgs
.flatMap((svg) => (Array.isArray(svg.category) ? svg.category : [svg.category]))
.flatMap((svg) =>
Array.isArray(svg.category) ? svg.category : [svg.category],
)
.filter((category, index, array) => array.indexOf(category) === index);
return categories;
};
export const getCategoriesForDirectory = () => {
const categories = svgs
.flatMap((svg) => (Array.isArray(svg.category) ? svg.category : [svg.category]))
.flatMap((svg) =>
Array.isArray(svg.category) ? svg.category : [svg.category],
)
.filter((category, index, array) => array.indexOf(category) === index)
.map((category) => ({
slug: category.toLowerCase()
slug: category.toLowerCase(),
}));
return categories;
};