MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / toComponent

Function toComponent

src/analyzers/react/index.ts:534–549  ·  view source on GitHub ↗
(
  name: string,
  node: TSESTree.FunctionDeclaration | TSESTree.VariableDeclarator | TSESTree.ClassDeclaration,
  type: string,
  componentType: string,
  metadata: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

532}
533
534function toComponent(
535 name: string,
536 node: TSESTree.FunctionDeclaration | TSESTree.VariableDeclarator | TSESTree.ClassDeclaration,
537 type: string,
538 componentType: string,
539 metadata: Record<string, unknown>
540): CodeComponent {
541 return {
542 name,
543 type,
544 componentType,
545 startLine: node.loc?.start.line ?? 1,
546 endLine: node.loc?.end.line ?? node.loc?.start.line ?? 1,
547 metadata
548 };
549}
550
551function dedupeComponents(components: CodeComponent[]): CodeComponent[] {
552 const seen = new Set<string>();

Callers 1

summarizeReactProgramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected