(filePath: string)
| 102 | const API_METHODS = 'GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS'; |
| 103 | |
| 104 | function languageForFile(filePath: string): Language { |
| 105 | const ext = ROUTE_EXT.exec(filePath)?.[1]; |
| 106 | switch (ext) { |
| 107 | case 'tsx': |
| 108 | return 'tsx'; |
| 109 | case 'jsx': |
| 110 | return 'jsx'; |
| 111 | case 'ts': |
| 112 | return 'typescript'; |
| 113 | default: |
| 114 | return 'javascript'; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | const IDENT = '[A-Za-z_$][\\w$]*'; |
| 119 |