gray-matter
gray-matter copied to clipboard
Property 'sections' does not exist on type 'GrayMatterFile<string>'.
const md = matter(fileContents, { excerpt: true, sections: true })
md.sections type doesn't exist in GrayMatterFile
I have the same issue, did you find any workaround?
I'm just hard parsing it
type Section = {
key: string
data: string
content: string
}
const contentJson = matter(contentMdStr, { excerpt: true, sections: true }) as matter.GrayMatterFile<any> & { sections: Array<Section> }
but there has to be a better approach.