Merge pull request #15 from Fluffy-Bean/deepsource-transform-7ae81505

style: format code with Prettier
This commit is contained in:
Michał 2024-05-28 19:02:44 +01:00 committed by GitHub
commit 0085442251
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View file

@ -26,8 +26,8 @@ const tags = defineCollection({
type: "content",
schema: z.object({
name: z.string(),
})
})
}),
});
export const collections = {
posts,

View file

@ -1,4 +1,5 @@
---
name: "Math"
---
``
``

View file

@ -1,4 +1,8 @@
import {type CollectionEntry, type ContentEntryMap, getCollection} from "astro:content";
import {
type CollectionEntry,
type ContentEntryMap,
getCollection,
} from "astro:content";
// https://github.com/hellotham/hello-astro/blob/e05706cf488bcec6e4c5494a622eedfc4e47d763/src/config.ts#L55C1-L62C2
export async function getPosts(collection: keyof ContentEntryMap) {
@ -44,7 +48,9 @@ export function getDaySuffix(date: Date): string {
return suffix;
}
export async function getTagsBySlug(postTags: string[]): Promise<CollectionEntry<"tags">[]> {
export async function getTagsBySlug(
postTags: string[],
): Promise<CollectionEntry<"tags">[]> {
const allTags: CollectionEntry<"tags">[] = await getCollection("tags");
const tags: CollectionEntry<"tags">[] = [];
postTags.forEach((postTag) => {
@ -53,4 +59,4 @@ export async function getTagsBySlug(postTags: string[]): Promise<CollectionEntry
});
});
return tags;
}
}