(source: string, filePath: string)
| 110 | * that means anything. |
| 111 | */ |
| 112 | export function readRoutes(source: string, filePath: string): SourceRoute[] { |
| 113 | if (!isRouteSource(filePath)) { |
| 114 | return []; |
| 115 | } |
| 116 | const lower = filePath.toLowerCase(); |
| 117 | const found = ANNOTATION_EXTENSIONS.some(extension => lower.endsWith(extension)) |
| 118 | ? readAnnotationRoutes(source) |
| 119 | : readScriptRoutes(source); |
| 120 | return dedupe(found).slice(0, MAX_ROUTES_PER_FILE); |
| 121 | } |
| 122 | |
| 123 | /** Method calls and decorators, which is how JavaScript, TypeScript and Python register. */ |
| 124 | function readScriptRoutes(source: string): SourceRoute[] { |
no test coverage detected