({
slug,
section
}: {
slug: string;
section?: string;
})
| 1 | import learnContent from '../../content/learn/learn.json'; |
| 2 | |
| 3 | export async function getLearnBySlug({ |
| 4 | slug, |
| 5 | section |
| 6 | }: { |
| 7 | slug: string; |
| 8 | section?: string; |
| 9 | }) { |
| 10 | const docContent = learnContent.find( |
| 11 | doc => doc.slug === slug && doc.section === section |
| 12 | ); |
| 13 | |
| 14 | return { |
| 15 | content: docContent?.content, |
| 16 | frontmatter: docContent?.frontmatter |
| 17 | }; |
| 18 | } |
no outgoing calls
no test coverage detected