This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const email = "my.email@my-domain.com" | |
const emailSplitParts = email.split('@'); | |
var emailFirst = emailSplitParts[0]; | |
var emailLast = emailSplitParts[1]; | |
const emailLastSplitParts = emailLast.split('.'); | |
const emailLastBeforeDot = emailLastSplitParts[0]; | |
var obscureText = function(targetText, textToObscure) { | |
return targetText.replace(textToObscure.substring(1, textToObscure.length - 1), '***'); |