Home / Function/ toFilePath() — supabase Function Reference

toFilePath() — supabase Function Reference

Architecture documentation for the toFilePath() function in Partial.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  070accdd_f25d_7bc5_e9b5_9ffd9a406977["toFilePath()"]
  e4dca78c_a009_9457_9893_c32a01231d09["fetchPartialsContent()"]
  e4dca78c_a009_9457_9893_c32a01231d09 -->|calls| 070accdd_f25d_7bc5_e9b5_9ffd9a406977
  790ab825_fd72_cafc_9ee2_d8f5b37c7cf2["getAttributeValue()"]
  070accdd_f25d_7bc5_e9b5_9ffd9a406977 -->|calls| 790ab825_fd72_cafc_9ee2_d8f5b37c7cf2
  8e1c5fe5_8daf_2e34_0373_2accfd5c8bb7["isMdFile()"]
  070accdd_f25d_7bc5_e9b5_9ffd9a406977 -->|calls| 8e1c5fe5_8daf_2e34_0373_2accfd5c8bb7
  style 070accdd_f25d_7bc5_e9b5_9ffd9a406977 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/directives/Partial.ts lines 63–74

function toFilePath(node: MdxJsxFlowElement) {
  const path = getAttributeValue(node, 'path')
  if (typeof path !== 'string' || !isMdFile(path)) {
    throw new Error('Invalid $Partial path: path must end with .mdx or .md')
  }

  const filePath = join(PARTIALS_DIRECTORY, path)
  if (!filePath.startsWith(PARTIALS_DIRECTORY)) {
    throw new Error(`Invalid $Partial path: Path must be inside ${PARTIALS_DIRECTORY}`)
  }
  return filePath
}

Subdomains

Frequently Asked Questions

What does toFilePath() do?
toFilePath() is a function in the supabase codebase.
What does toFilePath() call?
toFilePath() calls 2 function(s): getAttributeValue, isMdFile.
What calls toFilePath()?
toFilePath() is called by 1 function(s): fetchPartialsContent.

Analyze Your Own Codebase

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

Try Supermodel Free