← Files DataARCHIVED FILE

templates/data-app/base/src/owner-email.js

339 Bytes · Sep 30, 2026 · 23:19 UTC

↓ Download file

// Sites owner configuration and authenticated visitors use the same normalized email.
export function normalizeOwnerEmail(value) {
  if (typeof value !== "string" || /\p{Cc}/u.test(value)) return null;
  const email = value.trim().toLowerCase();
  return email.length <= 254 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(email) ? email : null;
}

SHA-256: 4bf602cf4a5fc05bebbadc0202366c8dec28fc3df621df29efa40a7dd43ac1d2