Skip to main content
Glama
domain-without-suffix.ts459 B
/** * Return the part of domain without suffix. * * Example: for domain 'foo.com', the result would be 'foo'. */ export default function getDomainWithoutSuffix( domain: string, suffix: string, ): string { // Note: here `domain` and `suffix` cannot have the same length because in // this case we set `domain` to `null` instead. It is thus safe to assume // that `suffix` is shorter than `domain`. return domain.slice(0, -suffix.length - 1); }

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/JoaoPedroLanca/mcp-web-tools'

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