Home / Function/ getComponentSourceFileContent() — ui Function Reference

getComponentSourceFileContent() — ui Function Reference

Architecture documentation for the getComponentSourceFileContent() function in rehype-component.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  fcaaaacb_8d26_81d2_e1a8_d8baeeac2743["getComponentSourceFileContent()"]
  a572535f_b25f_7501_dc60_c7a2d320a739["rehype-component.ts"]
  fcaaaacb_8d26_81d2_e1a8_d8baeeac2743 -->|defined in| a572535f_b25f_7501_dc60_c7a2d320a739
  c38c6bfc_2ef9_6855_c303_4188603dc06e["rehypeComponent()"]
  c38c6bfc_2ef9_6855_c303_4188603dc06e -->|calls| fcaaaacb_8d26_81d2_e1a8_d8baeeac2743
  b0a57047_43fa_bc18_c737_e1385bb1e84c["getNodeAttributeByName()"]
  fcaaaacb_8d26_81d2_e1a8_d8baeeac2743 -->|calls| b0a57047_43fa_bc18_c737_e1385bb1e84c
  style fcaaaacb_8d26_81d2_e1a8_d8baeeac2743 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/lib/rehype-component.ts lines 270–282

function getComponentSourceFileContent(node: UnistNode) {
  const src = getNodeAttributeByName(node, "src")?.value as string

  if (!src) {
    return null
  }

  // Read the source file.
  const filePath = path.join(process.cwd(), src)
  const source = fs.readFileSync(filePath, "utf8")

  return source
}

Subdomains

Called By

Frequently Asked Questions

What does getComponentSourceFileContent() do?
getComponentSourceFileContent() is a function in the ui codebase, defined in deprecated/www/lib/rehype-component.ts.
Where is getComponentSourceFileContent() defined?
getComponentSourceFileContent() is defined in deprecated/www/lib/rehype-component.ts at line 270.
What does getComponentSourceFileContent() call?
getComponentSourceFileContent() calls 1 function(s): getNodeAttributeByName.
What calls getComponentSourceFileContent()?
getComponentSourceFileContent() is called by 1 function(s): rehypeComponent.

Analyze Your Own Codebase

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

Try Supermodel Free