Skip to content

Instantly share code, notes, and snippets.

@ledunguit
Created August 20, 2025 09:49
Show Gist options
  • Save ledunguit/ec0e91ab43cbf7c33834004ff4b8da3f to your computer and use it in GitHub Desktop.
Save ledunguit/ec0e91ab43cbf7c33834004ff4b8da3f to your computer and use it in GitHub Desktop.
Fuck LEET SPEAK! WRITE NORMAL
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