Home / Function/ deepFilterSections() — supabase Function Reference

deepFilterSections() — supabase Function Reference

Architecture documentation for the deepFilterSections() function in NavigationMenu.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  5e3c332c_fb64_4f64_8914_13acc4a8bbc1["deepFilterSections()"]
  56de7ee3_3852_f23b_380e_758f5b769c08["NavigationMenuRefListItems()"]
  56de7ee3_3852_f23b_380e_758f5b769c08 -->|calls| 5e3c332c_fb64_4f64_8914_13acc4a8bbc1
  style 5e3c332c_fb64_4f64_8914_13acc4a8bbc1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts lines 18–45

export function deepFilterSections<T extends ICommonItem>(
  sections: T[],
  specFunctionIds: string[]
): T[] {
  return sections
    .filter(
      (section) =>
        section.type === 'category' ||
        section.type === 'markdown' ||
        specFunctionIds.includes(section.id)
    )
    .flatMap((section) => {
      if ('items' in section) {
        const items = deepFilterSections(section.items, specFunctionIds)

        // Only include this category (heading) if it has subitems
        if (items.length > 0) {
          return {
            ...section,
            items,
          }
        }

        return []
      }
      return section
    })
}

Subdomains

Frequently Asked Questions

What does deepFilterSections() do?
deepFilterSections() is a function in the supabase codebase.
What calls deepFilterSections()?
deepFilterSections() is called by 1 function(s): NavigationMenuRefListItems.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free