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

Function discriminated

packages/core/api/src/account/org-slug.test.ts:69–69  ·  view source on GitHub ↗
(base: string)

Source from the content-addressed store, hash-verified

67 const taken = (slugs: ReadonlyArray<string>) => async (slug: string) => slugs.includes(slug);
68 // `acme-corp` + "-" + 4 chars of the look-alike-free alphabet.
69 const discriminated = (base: string) => new RegExp(`^${base}-[a-z2-9]{4}$`);
70
71 it("uses the clean derivation when free", async () => {
72 expect(await generateOrgSlug("Acme Corp", taken([]))).toBe("acme-corp");

Callers 1

org-slug.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected