Skip to main content
Glama
getFormatFromExtension.ts777 B
export type Format = 'ts' | 'cjs' | 'esm' | 'json'; export type Extension = | '.ts' | '.tsx' | '.js' | '.jsx' | '.cjs' | '.cjsx' | '.mjs' | '.mjsx' | '.json' | '.json5'; export const getFormatFromExtension = (extension: Extension): Format => { switch (extension) { case '.ts': case '.tsx': return 'ts'; case '.cjs': case '.cjsx': return 'cjs'; case '.mjs': return 'esm'; case '.json': case '.json5': return 'json'; } return 'ts'; }; export const getExtensionFromFormat = (format: Format): Extension => { switch (format) { case 'ts': return '.ts'; case 'cjs': return '.cjs'; case 'json': return '.json'; case 'esm': return '.mjs'; } return '.ts'; };

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/aymericzip/intlayer'

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