Created
August 20, 2025 09:49
-
-
Save ledunguit/ec0e91ab43cbf7c33834004ff4b8da3f to your computer and use it in GitHub Desktop.
Fuck LEET SPEAK! WRITE NORMAL
This file contains hidden or 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
export function toLeetSpeak(text) { | |
if (typeof text !== "string") return ""; | |
return text | |
.replace(/e/gi, "3") | |
.replace(/a/gi, "4") | |
.replace(/s/gi, "5") | |
.replace(/t/gi, "7") | |
.replace(/o/gi, "0") | |
.replace(/i/gi, "1"); | |
} | |
export function fromLeetSpeak(text) { | |
if (typeof text !== "string") return ""; | |
return text | |
.replace(/3/g, "e") | |
.replace(/4/g, "a") | |
.replace(/5/g, "s") | |
.replace(/7/g, "t") | |
.replace(/0/g, "o") | |
.replace(/1/g, "i"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment