Last active
September 24, 2019 01:44
-
-
Save cuylerstuwe/0c583a3027fb52e2a9bc622bc226c824 to your computer and use it in GitHub Desktop.
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 maskExceptLastThreeChars = str => ( | |
str.replace( | |
/(?=.{4,})(.+)(.{3,}$)/, | |
(_, ...args) => "*".repeat(args[0].length) + args[1] | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution for this Facebook post: