Function
normalizeBlogFrontmatter
(frontmatter: Record<string, unknown>)
Source from the content-addressed store, hash-verified
| 156 | |
| 157 | // Schema expects 'path' & frontmatter provides 'slug' |
| 158 | function normalizeBlogFrontmatter(frontmatter: Record<string, unknown>): Record<string, unknown> { |
| 159 | return { |
| 160 | ...frontmatter, |
| 161 | path: typeof frontmatter.slug === 'string' ? `/blog/${frontmatter.slug}` : frontmatter.path, |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | // Keys are sorted to provide a more stable hash |
| 166 | function createContentHash(data: unknown): string { |
Tested by
no test coverage detected