* The binding a value holds and nothing more — `AvatarWithHoverCard` of * outline's `const Avatar = AvatarWithHoverCard`, past a type assertion (`= * Page as FC`) — or null for any other initializer.
(value: Node, context: ResolutionContext)
| 863 | * Page as FC`) — or null for any other initializer. |
| 864 | */ |
| 865 | function heldBinding(value: Node, context: ResolutionContext): string | null { |
| 866 | const code = stripCommentsForRegex(declarationText(value, context), 'typescript'); |
| 867 | const init = initializerAt(code, value.name.length); |
| 868 | if (init < 0) return null; |
| 869 | const held = /^\s*([A-Za-z_$][\w$]*)\s*(?:$|(?:as|satisfies)\s)/.exec(code.slice(init, statementEnd(code, init))); |
| 870 | return held && held[1] !== value.name ? held[1]! : null; |
| 871 | } |
| 872 | |
| 873 | /** |
| 874 | * The component of its own file a wrapper call around a declaration hands |
no test coverage detected