(node: ts.Node)
| 2749 | } |
| 2750 | |
| 2751 | function declarationName(node: ts.Node): string | undefined { |
| 2752 | if ( |
| 2753 | (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node) || ts.isClassDeclaration(node) || |
| 2754 | ts.isFunctionDeclaration(node) || ts.isModuleDeclaration(node)) && node.name !== undefined |
| 2755 | ) return node.name.text |
| 2756 | if (ts.isVariableStatement(node)) { |
| 2757 | return node.declarationList.declarations.map((declaration) => { |
| 2758 | if (ts.isIdentifier(declaration.name)) return declaration.name.text |
| 2759 | if (ts.isObjectBindingPattern(declaration.name)) { |
| 2760 | return declaration.name.elements.map((element) => |
| 2761 | element.propertyName?.getText(element.getSourceFile()) ?? element.name.getText(element.getSourceFile()) |
| 2762 | ).join(", ") |
| 2763 | } |
| 2764 | return "" |
| 2765 | }).filter(Boolean).join(", ") |
| 2766 | } |
| 2767 | return undefined |
| 2768 | } |
| 2769 | |
| 2770 | function publicDeclarationRange(node: ts.Node, name: string): readonly [number, number] { |
| 2771 | if (ts.isVariableStatement(node)) { |
no test coverage detected