* The component of its own file a wrapper call around a declaration hands * over: `const TableView = observer(TableViewInner)`, or mastodon's `const * MemoizedBlurhash = memo(Blurhash)`, whose component node has no body of its * own to render from.
(value: Node, context: ResolutionContext, nodes = context.getNodesInFile(value.filePath))
| 877 | * own to render from. |
| 878 | */ |
| 879 | function handedComponent(value: Node, context: ResolutionContext, nodes = context.getNodesInFile(value.filePath)): Node | null { |
| 880 | const code = stripCommentsForRegex(declarationText(value, context), 'typescript'); |
| 881 | const init = initializerAt(code, value.name.length); |
| 882 | const handed = init < 0 ? null : wrappedName(code.slice(init, statementEnd(code, init))); |
| 883 | return handed && isPascalCase(handed) && handed !== value.name |
| 884 | ? nodes.find((n) => n.name === handed && n.qualifiedName === handed && COMPONENT_KINDS.has(n.kind)) ?? null |
| 885 | : null; |
| 886 | } |
| 887 | |
| 888 | /** |
| 889 | * The name of the component a wrapper component's declaration hands its |
no test coverage detected