MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / extractEmailDomain

Function extractEmailDomain

apps/web/src/lib/email-domain.ts:35–43  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

33 * boundary — so a stale PSL is low-impact.
34 */
35export function extractEmailDomain(email: string): string | null {
36 const atIndex = email.lastIndexOf('@');
37 if (atIndex === -1) return null;
38 const host = email.slice(atIndex + 1).toLowerCase();
39 if (host.length === 0) return null;
40 const registrable = getDomain(host, { allowPrivateDomains: true });
41 if (registrable !== null) return registrable;
42 return `${host}.invalid`;
43}

Callers 3

createOrUpdateUserFunction · 0.90
POSTFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected