Skip to main content
Glama
camelCaseToKebabCase.ts413 B
/** * Convert a string to kebab-case * e.g. "MyNewComponent" => "my-new-component" */ export const camelCaseToKebabCase = (str: string): string => { // Split on transition from lower->upper: "MyNewComponent" => ["My", "New", "Component"] // Then lowercase each chunk and join by "-" return str .replace(/([a-z])([A-Z])/g, '$1-$2') .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2') .toLowerCase(); };

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