export default function hideEmail(email: string) { const atIndex = email.indexOf('@') const username = email.substring(0, atIndex) const domain = email.substring(atIndex + 1) const hiddenUsername = `${username.substring(0, 2)}**` return `${hiddenUsername}@${domain}` }