From 71074a8b49db95021613751bf1f50532200722b9 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Tue, 28 Oct 2025 15:14:21 +0100 Subject: [PATCH] fix: remove some type errors --- src/components/HeroCard.astro | 5 +++-- src/components/Image.astro | 10 +++++----- src/components/resources/Recipe.astro | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/HeroCard.astro b/src/components/HeroCard.astro index 8b4c6ec..2c2fd22 100644 --- a/src/components/HeroCard.astro +++ b/src/components/HeroCard.astro @@ -26,7 +26,9 @@ const t = useTranslations(Astro.url); const link = translatePath(`/${collection}/${id.split("/")[0]}`); -const hasCover = typeof cover === "string" ? !!cover?.length : !!cover?.src; +const image = cover as unknown; + +const hasCover = typeof image === "string" ? !!image?.length : !!cover?.src; --- { const src = typeof image === "string" ? image : image.src; - if (!src) return false; + if (!src) return ; try { - if (src.startsWith("/@fs") || src.startsWith("/_astro")) return true; + if (src.startsWith("/@fs") || src.startsWith("/_astro")) return; const res = await inferRemoteSize(src); if (res.format) { image.format = res.format; @@ -27,11 +27,11 @@ async function checkImage(image: ImageMetadata) { } else { console.log("Failed to load: ", src); } - return false; + return ; } catch (err) { console.log("\n"); console.log("Failed to fetch: ", src); - return false; + return ; } } diff --git a/src/components/resources/Recipe.astro b/src/components/resources/Recipe.astro index f0aab61..b5e4509 100644 --- a/src/components/resources/Recipe.astro +++ b/src/components/resources/Recipe.astro @@ -32,7 +32,7 @@ const instructions = resource?.content?.recipeInstructions || [];

Ingredients