( context: TypeContext | null | undefined, name: string )
| 6558 | } |
| 6559 | |
| 6560 | const typeParameterOf = ( |
| 6561 | context: TypeContext | null | undefined, |
| 6562 | name: string |
| 6563 | ): TSTypeParameter | undefined => { |
| 6564 | if (!context) return |
| 6565 | if ("node" in context) { |
| 6566 | return ( |
| 6567 | ("typeParameters" in context.node && |
| 6568 | context.node.typeParameters?.params.find( |
| 6569 | param => param.name.name === name |
| 6570 | )) || |
| 6571 | typeParameterOf(context.parent, name) |
| 6572 | ) |
| 6573 | } |
| 6574 | return ( |
| 6575 | ("typeParameters" in context && |
| 6576 | context.typeParameters?.params.find(param => param.name.name === name)) || |
| 6577 | typeParameterOf(context.parent, name) |
| 6578 | ) |
| 6579 | } |
| 6580 | |
| 6581 | const castOf = (node: Node): Node | undefined => { |
| 6582 | for (; isTransparent(node); node = node.expression) { |
no test coverage detected