MCPcopy Index your code
hub / github.com/CapSoftware/Cap / extractDomainFromEmail

Function extractDomainFromEmail

packages/database/auth/domain-utils.ts:21–31  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

19}
20
21function extractDomainFromEmail(email: string): string | null {
22 // TODO: replace with zod v4's z.email()
23 const emailValidation = z.string().email().safeParse(email);
24 if (!emailValidation.success) {
25 return null;
26 }
27
28 // Extract domain from validated email
29 const atIndex = email.lastIndexOf("@");
30 return atIndex !== -1 ? email.substring(atIndex + 1) : null;
31}
32
33function parseAllowedDomains(allowedDomainsConfig: string): string[] {
34 return allowedDomainsConfig

Callers 1

isEmailAllowedForSignupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected