Home / Function/ parseRegistryAndItemFromString() — ui Function Reference

parseRegistryAndItemFromString() — ui Function Reference

Architecture documentation for the parseRegistryAndItemFromString() function in parser.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  2e667fd3_c5cb_c8f8_4ba8_e2c7c337a609["parseRegistryAndItemFromString()"]
  653618de_8a1a_fdc1_3a0b_e1c479d72984["parser.ts"]
  2e667fd3_c5cb_c8f8_4ba8_e2c7c337a609 -->|defined in| 653618de_8a1a_fdc1_3a0b_e1c479d72984
  style 2e667fd3_c5cb_c8f8_4ba8_e2c7c337a609 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/registry/parser.ts lines 4–24

export function parseRegistryAndItemFromString(name: string) {
  if (!name.startsWith("@")) {
    return {
      registry: null,
      item: name,
    }
  }

  const match = name.match(REGISTRY_PATTERN)
  if (match) {
    return {
      registry: match[1],
      item: match[2],
    }
  }

  return {
    registry: null,
    item: name,
  }
}

Subdomains

Frequently Asked Questions

What does parseRegistryAndItemFromString() do?
parseRegistryAndItemFromString() is a function in the ui codebase, defined in packages/shadcn/src/registry/parser.ts.
Where is parseRegistryAndItemFromString() defined?
parseRegistryAndItemFromString() is defined in packages/shadcn/src/registry/parser.ts at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free