Home / Function/ fixFilePaths() — ui Function Reference

fixFilePaths() — ui Function Reference

Architecture documentation for the fixFilePaths() function in registry.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  2f1c60f1_9430_e7e1_db29_3cff5bbb6a4e["fixFilePaths()"]
  a2cd9f1d_8dbe_d488_4209_1dbd8f522cc1["registry.ts"]
  2f1c60f1_9430_e7e1_db29_3cff5bbb6a4e -->|defined in| a2cd9f1d_8dbe_d488_4209_1dbd8f522cc1
  e7d34ace_4c02_90be_4798_c4bf467583f2["getRegistryItem()"]
  e7d34ace_4c02_90be_4798_c4bf467583f2 -->|calls| 2f1c60f1_9430_e7e1_db29_3cff5bbb6a4e
  d5272230_4caa_3f85_bc48_89f8f73276a7["getFileTarget()"]
  2f1c60f1_9430_e7e1_db29_3cff5bbb6a4e -->|calls| d5272230_4caa_3f85_bc48_89f8f73276a7
  style 2f1c60f1_9430_e7e1_db29_3cff5bbb6a4e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/lib/registry.ts lines 215–231

function fixFilePaths(files: z.infer<typeof registryItemSchema>["files"]) {
  if (!files) {
    return []
  }

  // Resolve all paths relative to the first file's directory.
  const firstFilePath = files[0].path
  const firstFilePathDir = path.dirname(firstFilePath)

  return files.map((file) => {
    return {
      ...file,
      path: path.relative(firstFilePathDir, file.path),
      target: getFileTarget(file),
    }
  })
}

Subdomains

Called By

Frequently Asked Questions

What does fixFilePaths() do?
fixFilePaths() is a function in the ui codebase, defined in apps/v4/lib/registry.ts.
Where is fixFilePaths() defined?
fixFilePaths() is defined in apps/v4/lib/registry.ts at line 215.
What does fixFilePaths() call?
fixFilePaths() calls 1 function(s): getFileTarget.
What calls fixFilePaths()?
fixFilePaths() is called by 1 function(s): getRegistryItem.

Analyze Your Own Codebase

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

Try Supermodel Free