(email: string)
| 19 | } |
| 20 | |
| 21 | function 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 | |
| 33 | function parseAllowedDomains(allowedDomainsConfig: string): string[] { |
| 34 | return allowedDomainsConfig |
no outgoing calls
no test coverage detected