mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
- Move stores/utils/types to their relative directories (i.e chat stores in chat directory) - Move utility files to shared/utils - Move component files to shared/components - Move type definitions to shared/types - Move stores to shared/stores - Update import paths across the project
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';
|
|
};
|