(file: string)
| 84 | } |
| 85 | |
| 86 | function detectLang(file: string): string { |
| 87 | const ext = path.extname(file).toLowerCase(); |
| 88 | if (ext === '.py') return 'python'; |
| 89 | if (ext === '.go') return 'go'; |
| 90 | if (ext === '.rs') return 'rust'; |
| 91 | return 'js'; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Resolve an import specifier (as written) to a project-relative file path, or |