Skip to main content
Glama
Southclaws

Storyden

by Southclaws
slugify.ts882 B
// Matches the Go implementation in app/resources/mark/slugify.go const nonLetterNumberPattern = /[^\p{L}\p{M}\p{N}\-_]+/gu; const multiHyphenPattern = /-+/g; export function slugify(input: string): string { // Trim leading and trailing whitespace const trimmed = input.trim(); // NFKC normalization const normalized = trimmed.normalize("NFKC"); // Lowercase const lowercased = normalized.toLowerCase(); // Replace non-letter/number chars with hyphens const lettersReplaced = lowercased.replace(nonLetterNumberPattern, "-"); // Collapse multiple hyphens const collapsed = lettersReplaced.replace(multiHyphenPattern, "-"); // Trim leading and trailing hyphens/underscores const trimmedDividers = collapsed.replace(/^[-_]+|[-_]+$/g, ""); return trimmedDividers; } export function isSlug(input: string): boolean { return slugify(input) === input; }

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/Southclaws/storyden'

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