(node: ts.Node)
| 2819 | } |
| 2820 | |
| 2821 | function declarationName(node: ts.Node): string | undefined { |
| 2822 | if ( |
| 2823 | (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node) || ts.isClassDeclaration(node) || |
| 2824 | ts.isFunctionDeclaration(node) || ts.isModuleDeclaration(node)) && node.name !== undefined |
| 2825 | ) return node.name.text |
| 2826 | if (ts.isVariableStatement(node)) { |
| 2827 | return node.declarationList.declarations.map((declaration) => { |
| 2828 | if (ts.isIdentifier(declaration.name)) return declaration.name.text |
| 2829 | if (ts.isObjectBindingPattern(declaration.name)) { |
| 2830 | return declaration.name.elements.map((element) => |
| 2831 | element.propertyName?.getText(element.getSourceFile()) ?? element.name.getText(element.getSourceFile()) |
| 2832 | ).join(", ") |
| 2833 | } |
| 2834 | return "" |
| 2835 | }).filter(Boolean).join(", ") |
| 2836 | } |
| 2837 | return undefined |
| 2838 | } |
| 2839 | |
| 2840 | function publicDeclarationRange(node: ts.Node, name: string): readonly [number, number] { |
| 2841 | if (ts.isVariableStatement(node)) { |
no test coverage detected