initial
This commit is contained in:
8
layers/shared/utils/hide-email.ts
Normal file
8
layers/shared/utils/hide-email.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
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}`
|
||||
}
|
||||
Reference in New Issue
Block a user