|
1 | 1 | import { SyntaxKind } from 'ts-morph'; |
2 | 2 |
|
3 | 3 | /** The possible coverage types for documentation analysis */ |
4 | | -export const SINTAX_KIND_LITERAL_STRING = { |
5 | | - CLASSES: 'classes', |
6 | | - METHODS: 'methods', |
7 | | - FUNCTIONS: 'functions', |
8 | | - INTERFACES: 'interfaces', |
9 | | - ENUMS: 'enums', |
10 | | - VARIABLES: 'variables', |
11 | | - PROPERTIES: 'properties', |
12 | | - TYPES: 'types', |
13 | | -} as const; |
14 | | - |
15 | 4 | export type CoverageType = |
16 | | - (typeof SINTAX_KIND_LITERAL_STRING)[keyof typeof SINTAX_KIND_LITERAL_STRING]; |
| 5 | + | 'classes' |
| 6 | + | 'methods' |
| 7 | + | 'functions' |
| 8 | + | 'interfaces' |
| 9 | + | 'enums' |
| 10 | + | 'variables' |
| 11 | + | 'properties' |
| 12 | + | 'types'; |
17 | 13 |
|
18 | 14 | /** Maps the SyntaxKind from the library ts-morph to the coverage type. */ |
19 | 15 | export const SYNTAX_COVERAGE_MAP = new Map<SyntaxKind, CoverageType>([ |
20 | | - [SyntaxKind.ClassDeclaration, SINTAX_KIND_LITERAL_STRING.CLASSES], |
21 | | - [SyntaxKind.MethodDeclaration, SINTAX_KIND_LITERAL_STRING.METHODS], |
22 | | - [SyntaxKind.FunctionDeclaration, SINTAX_KIND_LITERAL_STRING.FUNCTIONS], |
23 | | - [SyntaxKind.InterfaceDeclaration, SINTAX_KIND_LITERAL_STRING.INTERFACES], |
24 | | - [SyntaxKind.EnumDeclaration, SINTAX_KIND_LITERAL_STRING.ENUMS], |
25 | | - [SyntaxKind.VariableDeclaration, SINTAX_KIND_LITERAL_STRING.VARIABLES], |
26 | | - [SyntaxKind.VariableStatement, SINTAX_KIND_LITERAL_STRING.VARIABLES], |
27 | | - [SyntaxKind.PropertyDeclaration, SINTAX_KIND_LITERAL_STRING.PROPERTIES], |
28 | | - [SyntaxKind.TypeAliasDeclaration, SINTAX_KIND_LITERAL_STRING.TYPES], |
| 16 | + [SyntaxKind.ClassDeclaration, 'classes'], |
| 17 | + [SyntaxKind.MethodDeclaration, 'methods'], |
| 18 | + [SyntaxKind.FunctionDeclaration, 'functions'], |
| 19 | + [SyntaxKind.InterfaceDeclaration, 'interfaces'], |
| 20 | + [SyntaxKind.EnumDeclaration, 'enums'], |
| 21 | + [SyntaxKind.VariableDeclaration, 'variables'], |
| 22 | + [SyntaxKind.VariableStatement, 'variables'], |
| 23 | + [SyntaxKind.PropertyDeclaration, 'properties'], |
| 24 | + [SyntaxKind.TypeAliasDeclaration, 'types'], |
29 | 25 | ]); |
30 | 26 |
|
31 | 27 | /** The undocumented node is the node that is not documented and has the information for the report. */ |
|
0 commit comments