MCPcopy
hub / github.com/cursor/community-plugins / slugify

Function slugify

apps/cursor/src/lib/slug.ts:21–29  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

19 * rather than turned into separators.
20 */
21export function slugify(value: string): string {
22 return value
23 .toLowerCase()
24 .replace(/['".]/g, "")
25 .replace(/[^a-z0-9]+/g, "-")
26 .replace(/^-+|-+$/g, "")
27 .slice(0, MAX_SLUG_LENGTH)
28 .replace(/-+$/g, "");
29}
30
31/**
32 * Resolve a component's effective slug: an explicit slug if provided, else one

Callers 3

draftToComponentInputFunction · 0.90
parseGitHubPluginFunction · 0.90
resolveComponentSlugFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected