diff options
| author | Fuwn <[email protected]> | 2026-03-01 16:20:51 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-03-01 16:21:02 -0800 |
| commit | eae5d24d9e79e59a19d4721caaeaa0ca650ecb33 (patch) | |
| tree | 1b685bb248e051dfa26d2bfdebe6689402dd93c5 /src/lib/Data/Birthday/primary.ts | |
| parent | chore(tooling): remove legacy eslint and prettier (diff) | |
| download | due.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.tar.xz due.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.zip | |
chore(biome): drop formatter style overrides
Diffstat (limited to 'src/lib/Data/Birthday/primary.ts')
| -rw-r--r-- | src/lib/Data/Birthday/primary.ts | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/lib/Data/Birthday/primary.ts b/src/lib/Data/Birthday/primary.ts index 5f8ee1d0..26a7af76 100644 --- a/src/lib/Data/Birthday/primary.ts +++ b/src/lib/Data/Birthday/primary.ts @@ -1,27 +1,34 @@ -import root from '$lib/Utility/root'; +import root from "$lib/Utility/root"; export interface aniSearchBirthday { - name: string; - image: string; + name: string; + image: string; } const isAniSearchBirthday = (entry: unknown): entry is aniSearchBirthday => - typeof entry === 'object' && - entry !== null && - typeof (entry as { name?: unknown }).name === 'string' && - typeof (entry as { image?: unknown }).image === 'string'; + typeof entry === "object" && + entry !== null && + typeof (entry as { name?: unknown }).name === "string" && + typeof (entry as { image?: unknown }).image === "string"; export const aniSearchBirthdays = async ( - month: number, - day: number + month: number, + day: number, ): Promise<aniSearchBirthday[]> => { - const response = await fetch(root(`/api/birthdays/primary?month=${month}&day=${day}`), {}); + const response = await fetch( + root(`/api/birthdays/primary?month=${month}&day=${day}`), + {}, + ); - if (!response.ok) throw new Error(`Primary birthdays request failed with ${response.status}.`); + if (!response.ok) + throw new Error( + `Primary birthdays request failed with ${response.status}.`, + ); - const data: unknown = await response.json(); + const data: unknown = await response.json(); - if (!Array.isArray(data)) throw new Error('Primary birthdays response was not an array.'); + if (!Array.isArray(data)) + throw new Error("Primary birthdays response was not an array."); - return data.filter(isAniSearchBirthday); + return data.filter(isAniSearchBirthday); }; |