(email: string)
| 101 | } |
| 102 | |
| 103 | export function validateEmail(email: string) { |
| 104 | const trimmedEmail = (email || '').trim().toLocaleLowerCase(); |
| 105 | if (!trimmedEmail) { |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | const requiredCharsNotInEdges = ['@', '.']; |
| 110 | return requiredCharsNotInEdges.every((char) => |
| 111 | trimmedEmail.includes(char) && !trimmedEmail.startsWith(char) && !trimmedEmail.endsWith(char) |
| 112 | ); |
| 113 | } |
| 114 | |
| 115 | export function validateUrl(url: string) { |
| 116 | const trimmedUrl = (url || '').trim().toLocaleLowerCase(); |
no outgoing calls
no test coverage detected