diff --git a/packages/cli/src/lib/markdown.ts b/packages/cli/src/lib/markdown.ts index 0a26218..fc88753 100644 --- a/packages/cli/src/lib/markdown.ts +++ b/packages/cli/src/lib/markdown.ts @@ -40,7 +40,11 @@ export function parseFrontmatter( raw = toml.parse(frontmatterStr) as Record; } else { // Use CORE_SCHEMA to keep dates as strings rather than Date objects - raw = (yaml.load(frontmatterStr, { schema: yaml.CORE_SCHEMA }) as Record) ?? {}; + raw = + (yaml.load(frontmatterStr, { schema: yaml.CORE_SCHEMA }) as Record< + string, + unknown + >) ?? {}; } // Apply field mappings to normalize to standard PostFrontmatter fields diff --git a/packages/cli/test/markdown.test.ts b/packages/cli/test/markdown.test.ts index 7bd042c..f7aa692 100644 --- a/packages/cli/test/markdown.test.ts +++ b/packages/cli/test/markdown.test.ts @@ -79,7 +79,9 @@ excerpt: > --- `; const { rawFrontmatter } = parseFrontmatter(content); - expect(rawFrontmatter.excerpt).toBe("This is a folded multiline string\n"); + expect(rawFrontmatter.excerpt).toBe( + "This is a folded multiline string\n", + ); }); it("parses YAML stripped folded multiline string", () => { @@ -90,7 +92,9 @@ excerpt: >- --- `; const { rawFrontmatter } = parseFrontmatter(content); - expect(rawFrontmatter.excerpt).toBe("This is a stripped folded multiline string"); + expect(rawFrontmatter.excerpt).toBe( + "This is a stripped folded multiline string", + ); }); it("parses YAML literal multiline string", () => { @@ -101,7 +105,9 @@ excerpt: | --- `; const { rawFrontmatter } = parseFrontmatter(content); - expect(rawFrontmatter.excerpt).toBe("This is a literal\nmultiline string\n"); + expect(rawFrontmatter.excerpt).toBe( + "This is a literal\nmultiline string\n", + ); }); it("parses YAML kept literal multiline string", () => { @@ -114,7 +120,9 @@ end: true --- `; const { rawFrontmatter } = parseFrontmatter(content); - expect(rawFrontmatter.excerpt).toBe("This is a kept literal\nmultiline string\n\n"); + expect(rawFrontmatter.excerpt).toBe( + "This is a kept literal\nmultiline string\n\n", + ); }); it("parses boolean true", () => { @@ -339,7 +347,9 @@ categories: [news, updates] unpublished: true --- `; - const { frontmatter } = parseFrontmatter(content, { draft: "unpublished" }); + const { frontmatter } = parseFrontmatter(content, { + draft: "unpublished", + }); expect(frontmatter.draft).toBe(true); });