Clean up according to TS hints
1 file changed, 1 insertion(+), 3 deletions(-)
changed files
M src/posts.ts → src/posts.ts
@@ -2,7 +2,6 @@ import path from "node:path"; import fs from "node:fs/promises"; import { matter } from "toml-matter"; -import * as marked from "marked"; type MatterFile = ReturnType<typeof matter>;@@ -30,7 +29,6 @@ let tags = new Set<string>(); let posts = new Array<Post>(); const subdir = path.join(root, inputDir); for (let pathname of await fs.readdir(subdir)) { - const pathFromDir = path.join(inputDir, pathname); const pathFromRoot = path.join(subdir, pathname); const stat = await fs.stat(pathFromRoot); if (stat.isFile() && path.extname(pathname) === ".md") {@@ -43,7 +41,7 @@ const url = pathFromRoot.replace(root, "").replace(".md", "/"); const file = await getPost(input); - (file.data.taxonomies as any)?.tags?.map((t: string) => + (file.data["taxonomies"] as any)?.tags?.map((t: string) => tags.add(t.toLowerCase()), ); posts.push({