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

Function slugifyOrgName

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

Source from the content-addressed store, hash-verified

149 * names, etc.) — callers fall back to a generated handle.
150 */
151export const slugifyOrgName = (name: string): string | null => {
152 const slug = name
153 .normalize("NFKD")
154 .replace(/\p{M}+/gu, "")
155 .toLowerCase()
156 .replace(/[^a-z0-9]+/g, "-")
157 .replace(/^-+|-+$/g, "")
158 .slice(0, 48)
159 .replace(/-+$/g, "");
160 if (slug.length < 2 || !ORG_SLUG_PATTERN.test(slug)) return null;
161 return slug;
162};
163
164// Discriminator alphabet: lowercase base32 without the look-alikes (0/o, 1/l)
165// 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