Home / Function/ getContentFilePath() — supabase Function Reference

getContentFilePath() — supabase Function Reference

Architecture documentation for the getContentFilePath() function in Connect.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  5d5315d4_34ce_e96b_4aa1_ea6d63eea71d["getContentFilePath()"]
  7a580dbf_0dd5_87fe_b7f0_afad9b0cdd6f["Connect()"]
  7a580dbf_0dd5_87fe_b7f0_afad9b0cdd6f -->|calls| 5d5315d4_34ce_e96b_4aa1_ea6d63eea71d
  style 5d5315d4_34ce_e96b_4aa1_ea6d63eea71d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Connect/Connect.utils.ts lines 14–45

export const getContentFilePath = ({
  connectionObject,
  selectedParent,
  selectedChild,
  selectedGrandchild,
}: {
  selectedParent: string
  selectedChild: string
  selectedGrandchild: string
  connectionObject: ConnectionType[]
}) => {
  const parent = connectionObject.find((item) => item.key === selectedParent)

  if (parent) {
    const child = parent.children.find((child) => child.key === selectedChild)

    // check grandchild first, then child, then parent as the fallback
    if (child) {
      const grandchild = child.children.find((grandchild) => grandchild.key === selectedGrandchild)

      if (grandchild) {
        return `${selectedParent}/${selectedChild}/${selectedGrandchild}`
      } else {
        return `${selectedParent}/${selectedChild}`
      }
    } else {
      return selectedParent
    }
  }

  return ''
}

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free