Migrate to typescript

This commit is contained in:
prototypa
2023-01-02 10:51:51 -05:00
parent ba0e67b55f
commit f158d32181
28 changed files with 172 additions and 85 deletions

View File

@ -18,7 +18,7 @@ export async function getStaticPaths({ paginate }) {
typeof post.category === 'string' && categories.add(post.category.toLowerCase());
});
return Array.from(categories).map((category) =>
return Array.from(categories).map((category: string) =>
paginate(
posts.filter((post) => typeof post.category === 'string' && category === post.category.toLowerCase()),
{

View File

@ -18,7 +18,7 @@ export async function getStaticPaths({ paginate }) {
Array.isArray(post.tags) && post.tags.map((tag) => tags.add(tag.toLowerCase()));
});
return Array.from(tags).map((tag) =>
return Array.from(tags).map((tag: string) =>
paginate(
posts.filter((post) => Array.isArray(post.tags) && post.tags.find((elem) => elem.toLowerCase() === tag)),
{