MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / validateEmail

Function validateEmail

public/ts/utils/misc.ts:103–113  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

101}
102
103export 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
115export function validateUrl(url: string) {
116 const trimmedUrl = (url || '').trim().toLocaleLowerCase();

Callers 4

misc_test.tsFile · 0.90
postFunction · 0.90
postFunction · 0.90
postFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected