mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-03-09 21:50:36 +00:00
* fix: enhance prompt fix * fix: added error capture on api error * fix: replaced error with log for wrong files selected by bolt
25 lines
479 B
TypeScript
25 lines
479 B
TypeScript
export const getLanguageFromExtension = (ext: string): string => {
|
|
const map: Record<string, string> = {
|
|
js: 'javascript',
|
|
jsx: 'jsx',
|
|
ts: 'typescript',
|
|
tsx: 'tsx',
|
|
json: 'json',
|
|
html: 'html',
|
|
css: 'css',
|
|
py: 'python',
|
|
java: 'java',
|
|
rb: 'ruby',
|
|
cpp: 'cpp',
|
|
c: 'c',
|
|
cs: 'csharp',
|
|
go: 'go',
|
|
rs: 'rust',
|
|
php: 'php',
|
|
swift: 'swift',
|
|
md: 'plaintext',
|
|
sh: 'bash',
|
|
};
|
|
return map[ext] || 'typescript';
|
|
};
|