splitTreeBy() — supabase Function Reference
Architecture documentation for the splitTreeBy() function in helpers.mdx.ts from the supabase codebase.
Entity Profile
Dependency Diagram
graph TD 8e785252_1103_5454_842f_d5c44fb39fd2["splitTreeBy()"] 7920f0ed_264a_f954_6f8a_ec73ded46618["processMdx()"] 7920f0ed_264a_f954_6f8a_ec73ded46618 -->|calls| 8e785252_1103_5454_842f_d5c44fb39fd2 style 8e785252_1103_5454_842f_d5c44fb39fd2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/docs/scripts/helpers.mdx.ts lines 93–105
function splitTreeBy(tree: Root, predicate: (node: Content) => boolean) {
return tree.children.reduce<Root[]>((trees, node) => {
const [lastTree] = trees.slice(-1)
if (!lastTree || predicate(node)) {
const tree: Root = u('root', [node])
return trees.concat(tree)
}
lastTree.children.push(node)
return trees
}, [])
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does splitTreeBy() do?
splitTreeBy() is a function in the supabase codebase.
What calls splitTreeBy()?
splitTreeBy() is called by 1 function(s): processMdx.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free