aboutsummaryrefslogtreecommitdiff
path: root/_pastebins/2021-04-03-javascript-naive-slugify.md
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-07 22:11:40 -0300
committerEuAndreh <eu@euandre.org>2021-06-07 22:11:40 -0300
commitf285818db4b7a783120882340e193dcf572b383f (patch)
tree6f6c13e5cd56a9be280b067567ffffe9b1b67605 /_pastebins/2021-04-03-javascript-naive-slugify.md
parentTODOs.md: Add #task-6a3a99ec-dd86-b8b3-b1eb-f9b9a4298f3a (diff)
parentAdd article on Codd's paper (diff)
downloadeuandre.org-f285818db4b7a783120882340e193dcf572b383f.tar.gz
euandre.org-f285818db4b7a783120882340e193dcf572b383f.tar.xz
Merge remote-tracking branch 'refs/remotes/vps/main'
Diffstat (limited to '_pastebins/2021-04-03-javascript-naive-slugify.md')
-rw-r--r--_pastebins/2021-04-03-javascript-naive-slugify.md34
1 files changed, 17 insertions, 17 deletions
diff --git a/_pastebins/2021-04-03-javascript-naive-slugify.md b/_pastebins/2021-04-03-javascript-naive-slugify.md
index 05251c7..ce038fd 100644
--- a/_pastebins/2021-04-03-javascript-naive-slugify.md
+++ b/_pastebins/2021-04-03-javascript-naive-slugify.md
@@ -16,23 +16,23 @@ ref: javascript-naive-slugify
const s = "Pézão: açaí, saci-pererê.";
function slugify(s) {
- return s
- .toLowerCase()
- .replaceAll(":", "")
- .replaceAll(".", "")
- .replaceAll(",", "")
- .replaceAll("-", "")
- .replaceAll("á", "a")
- .replaceAll("ã", "a")
- .replaceAll("à", "a")
- .replaceAll("é", "e")
- .replaceAll("ê", "e")
- .replaceAll("í", "i")
- .replaceAll("ó", "o")
- .replaceAll("ô", "o")
- .replaceAll("ú", "u")
- .replaceAll("ü", "u")
- .replaceAll("ç", "c");
+ return s
+ .toLowerCase()
+ .replaceAll(":", "")
+ .replaceAll(".", "")
+ .replaceAll(",", "")
+ .replaceAll("-", "")
+ .replaceAll("á", "a")
+ .replaceAll("ã", "a")
+ .replaceAll("à", "a")
+ .replaceAll("é", "e")
+ .replaceAll("ê", "e")
+ .replaceAll("í", "i")
+ .replaceAll("ó", "o")
+ .replaceAll("ô", "o")
+ .replaceAll("ú", "u")
+ .replaceAll("ü", "u")
+ .replaceAll("ç", "c");
}
console.log(slugify(s));