diff options
author | EuAndreh <eu@euandre.org> | 2021-06-07 22:11:40 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-07 22:11:40 -0300 |
commit | f285818db4b7a783120882340e193dcf572b383f (patch) | |
tree | 6f6c13e5cd56a9be280b067567ffffe9b1b67605 /_pastebins/2021-04-03-javascript-naive-slugify.md | |
parent | TODOs.md: Add #task-6a3a99ec-dd86-b8b3-b1eb-f9b9a4298f3a (diff) | |
parent | Add article on Codd's paper (diff) | |
download | euandre.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.md | 34 |
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)); |