(decl: typescript.VariableDeclaration)
| 141 | const TARGETS: Record<string, string> = { route: 'Route', namespace: 'Namespace' }; |
| 142 | |
| 143 | function isTargetTypedDeclaration(decl: typescript.VariableDeclaration): boolean { |
| 144 | if (!typescript.isIdentifier(decl.name)) { |
| 145 | return false; |
| 146 | } |
| 147 | const expectedType = TARGETS[decl.name.text]; |
| 148 | if (!expectedType) { |
| 149 | return false; |
| 150 | } |
| 151 | if (decl.type && typescript.isTypeReferenceNode(decl.type)) { |
| 152 | const typeName = decl.type.typeName; |
| 153 | if (typescript.isIdentifier(typeName) && typeName.text === expectedType) { |
| 154 | return true; |
| 155 | } |
| 156 | } |
| 157 | return false; |
| 158 | } |
| 159 | |
| 160 | function collectDescriptionEdits(sourceFile: typescript.SourceFile): DescriptionEdit[] { |
| 161 | const edits: DescriptionEdit[] = []; |
no outgoing calls
no test coverage detected