diff options
Diffstat (limited to '')
-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)); |