summaryrefslogtreecommitdiff
path: root/src/content/pastebins/2021/04/03/naive-slugify-js.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/pastebins/2021/04/03/naive-slugify-js.adoc')
-rw-r--r--src/content/pastebins/2021/04/03/naive-slugify-js.adoc28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/content/pastebins/2021/04/03/naive-slugify-js.adoc b/src/content/pastebins/2021/04/03/naive-slugify-js.adoc
deleted file mode 100644
index 184ce97..0000000
--- a/src/content/pastebins/2021/04/03/naive-slugify-js.adoc
+++ /dev/null
@@ -1,28 +0,0 @@
-= JavaScript naive slugify
-:updatedat: 2021-08-15
-
-[source,javascript]
-----
-const s = "Pézão: açaí, saci-pererê.";
-
-const slugify = s =>
- 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));
-----