--- title: Astro is hard.... description: Arugh pubDate: 2024-05-28 tags: - astro - typescript --- import Note from "../../components/Note.astro"; - I've been trying to learn typescript through trying astro - Astro is hard, due to all the issues I've encountered ```typescript export async function getTagsBySlug(postTags: string[]): Promise[]> { // Collect all the tags from collections const allTags: CollectionEntry<"tags">[] = await getCollection("tags"); // Loop through all the tags in a post and the tags in the collections // To see if they match, if they do we'll return them const tags: CollectionEntry<"tags">[] = []; postTags.forEach((postTag) => { allTags.forEach((allTag) => { if (allTag.slug === postTag) tags.push(allTag); }); }); // Yeet return tags; } ```