Home / Function/ findMenuItemByUrl() — supabase Function Reference

findMenuItemByUrl() — supabase Function Reference

Architecture documentation for the findMenuItemByUrl() function in Breadcrumbs.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  6cb92a85_a42b_2e4a_b1cd_49fb4295bb1e["findMenuItemByUrl()"]
  5f4db0c7_143a_6760_4b0f_51f5fff05cce["useBreadcrumbs()"]
  5f4db0c7_143a_6760_4b0f_51f5fff05cce -->|calls| 6cb92a85_a42b_2e4a_b1cd_49fb4295bb1e
  style 6cb92a85_a42b_2e4a_b1cd_49fb4295bb1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/components/Breadcrumbs.tsx lines 184–202

function findMenuItemByUrl(menu: any, targetUrl: string, parents: any[] = []) {
  // If the menu has items, recursively search through them
  if (menu.items) {
    for (let item of menu.items) {
      const result = findMenuItemByUrl(item, targetUrl, [...parents, menu])
      if (result) {
        return result
      }
    }
  }

  // Check if the current menu object itself has the target URL
  if (menu.url === targetUrl) {
    return [...parents, menu]
  }

  // If the URL is not found, return null
  return null
}

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free