Skip to main content
Glama
languageUtils.ts803 B
/** * @fileOverview: Language Detection Utilities * @module: LanguageUtils * @keyFunctions: * - getLanguageFromPath: Detect programming language from file extension * @context: Provides language detection for AI code analysis tools */ import * as path from 'path'; export function getLanguageFromPath(filePath: string): string { const ext = path.extname(filePath).toLowerCase(); const languageMap: Record<string, string> = { '.ts': 'typescript', '.tsx': 'typescript', '.js': 'javascript', '.jsx': 'javascript', '.py': 'python', '.java': 'java', '.cpp': 'cpp', '.c': 'c', '.cs': 'csharp', '.php': 'php', '.rb': 'ruby', '.go': 'go', '.rs': 'rust', '.swift': 'swift', '.kt': 'kotlin', }; return languageMap[ext] || 'unknown'; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbarron/AmbianceMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server