MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / declaredAs

Function declaredAs

src/resolution/frameworks/react.ts:557–560  ·  view source on GitHub ↗
(binding: string)

Source from the content-addressed store, hash-verified

555 if (local) {
556 const nodes = context.getNodesInFile(file);
557 const declaredAs = (binding: string): Node | undefined => {
558 const named = nodes.filter((n) => n.name === binding && EXPORTED_COMPONENT_KINDS.has(n.kind));
559 return named.find((n) => n.qualifiedName === binding) ?? named[0];
560 };
561 const exported = declaredAs(local);
562 // A constant that holds another binding is that binding: outline's
563 // `Avatar/index.ts` is `const Avatar = AvatarWithHoverCard; export { Avatar }`.

Callers 1

exportedComponentFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected