Home / Function/ collectDisabledPaths() — supabase Function Reference

collectDisabledPaths() — supabase Function Reference

Architecture documentation for the collectDisabledPaths() function in NavigationPageStatus.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  a03c92fe_6453_0afc_7e5b_7e9bbd9e669e["collectDisabledPaths()"]
  44f452ed_9ac1_ef7b_d0f6_38537df333ce["getDisabledGuidePaths()"]
  44f452ed_9ac1_ef7b_d0f6_38537df333ce -->|calls| a03c92fe_6453_0afc_7e5b_7e9bbd9e669e
  523c06d1_f236_c878_6046_3d42a2a8ab42["normalizeUrl()"]
  a03c92fe_6453_0afc_7e5b_7e9bbd9e669e -->|calls| 523c06d1_f236_c878_6046_3d42a2a8ab42
  style a03c92fe_6453_0afc_7e5b_7e9bbd9e669e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/NavigationPageStatus.utils.ts lines 58–87

function collectDisabledPaths(
  items: Readonly<ConditionalNavItem[] | ConditionalNavItem[][]>,
  disabledPaths: Set<string>,
  parentDisabled: boolean = false
): void {
  for (const item of items) {
    if (Array.isArray(item)) {
      // Handle nested arrays (like in GLOBAL_MENU_ITEMS)
      collectDisabledPaths(item, disabledPaths, parentDisabled)
    } else {
      const isCurrentDisabled = parentDisabled || item.enabled === false
      const itemUrl = item.url || item.href

      if (itemUrl && itemUrl.startsWith('/guides/')) {
        const normalizedUrl = normalizeUrl(itemUrl)
        if (isCurrentDisabled) {
          disabledPaths.add(normalizedUrl)
        }
      }

      // Recursively check children, passing down the disabled status
      if (item.items) {
        collectDisabledPaths(item.items, disabledPaths, isCurrentDisabled)
      }
      if (item.menuItems) {
        collectDisabledPaths(item.menuItems, disabledPaths, isCurrentDisabled)
      }
    }
  }
}

Subdomains

Frequently Asked Questions

What does collectDisabledPaths() do?
collectDisabledPaths() is a function in the supabase codebase.
What does collectDisabledPaths() call?
collectDisabledPaths() calls 1 function(s): normalizeUrl.
What calls collectDisabledPaths()?
collectDisabledPaths() is called by 1 function(s): getDisabledGuidePaths.

Analyze Your Own Codebase

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

Try Supermodel Free