MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / slugifyOrgName

Function slugifyOrgName

packages/core/api/src/account/org-slug.ts:142–153  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

140 * names, etc.) — callers fall back to a generated handle.
141 */
142export const slugifyOrgName = (name: string): string | null => {
143 const slug = name
144 .normalize("NFKD")
145 .replace(/\p{M}+/gu, "")
146 .toLowerCase()
147 .replace(/[^a-z0-9]+/g, "-")
148 .replace(/^-+|-+$/g, "")
149 .slice(0, 48)
150 .replace(/-+$/g, "");
151 if (slug.length < 2 || !ORG_SLUG_PATTERN.test(slug)) return null;
152 return slug;
153};
154
155// Discriminator alphabet: lowercase base32 without the look-alikes (0/o, 1/l)
156// so a slug read aloud or retyped from a screenshot survives the round trip.

Callers 2

org-slug.test.tsFile · 0.90
generateOrgSlugFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected