Skip to content

Commit

Permalink
Fix union type check (withastro#3929)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanthomasdev authored Jul 28, 2023
1 parent 9e65f81 commit 1b26c36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/RecipesNav.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { recipePages } from '~/content';
import { createIsLangEntry, isEnglishEntry } from '~/content/config';
import { createIsLangEntry, isEnglishEntry, DocsEntry } from '~/content/config';
import { getLanguageFromURL, stripLangFromSlug } from '~/util';
import CardsNav from './NavGrid/CardsNav.astro';
Expand All @@ -16,7 +16,7 @@ const englishRecipes = recipePages.filter(isEnglishEntry);
const recipes = englishRecipes.map((fallback) => {
const slug = stripLangFromSlug(fallback.slug);
const translation = langRecipes.find((doc) => stripLangFromSlug(doc.slug) === slug);
return translation || fallback;
return (translation as DocsEntry<'recipe'>) || (fallback as DocsEntry<'recipe'>);
});
---

Expand Down

0 comments on commit 1b26c36

Please sign in to comment.