mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 14:49:10 +03:00
* test fuma toc * make toc work * ok toc * ui-patterns toc * fix types * cleanup * fix overflow issues * cleanup * fix loading w * Update apps/docs/components/GuidesTableOfContents.tsx * fix prettier * format * install deps * target ES2018 * tweak regex * update docs test snapshots * fix useSubscribeTocRerender
10 lines
247 B
TypeScript
10 lines
247 B
TypeScript
// import type { RootContent } from 'mdast'
|
|
|
|
export function flattenNode(node: any): string {
|
|
if ('children' in node) return node.children.map((child: any) => flattenNode(child)).join('')
|
|
|
|
if ('value' in node) return node.value
|
|
|
|
return ''
|
|
}
|