UNPKG

openai-cli-unofficial

Version:

A powerful OpenAI CLI Coding Agent built with TypeScript

58 lines 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isImageFile = isImageFile; exports.getLanguageForFile = getLanguageForFile; const imageExtensions = new Set([ '.png', '.jpeg', '.jpg', '.webp', '.gif', ]); function isImageFile(filePath) { const extension = ('.' + filePath.split('.').pop()).toLowerCase(); return imageExtensions.has(extension); } const languageMap = { '.js': 'javascript', '.jsx': 'javascript', '.ts': 'typescript', '.tsx': 'typescript', '.json': 'json', '.py': 'python', '.rb': 'ruby', '.java': 'java', '.go': 'go', '.php': 'php', '.cs': 'csharp', '.cpp': 'cpp', '.c': 'c', '.html': 'html', '.css': 'css', '.scss': 'scss', '.less': 'less', '.md': 'markdown', '.sh': 'shell', '.bash': 'shell', '.zsh': 'shell', '.yaml': 'yaml', '.yml': 'yaml', '.xml': 'xml', '.toml': 'toml', '.ini': 'ini', '.sql': 'sql', '.rs': 'rust', '.kt': 'kotlin', '.swift': 'swift', '.dart': 'dart', '.lua': 'lua', '.pl': 'perl', '.r': 'r', '.ex': 'elixir', '.exs': 'elixir', }; function getLanguageForFile(filePath) { const extension = ('.' + filePath.split('.').pop()).toLowerCase(); return languageMap[extension] || ''; } //# sourceMappingURL=file-types.js.map