diff options
author | EuAndreh <eu@euandre.org> | 2025-04-30 06:23:27 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-30 06:33:36 -0300 |
commit | 61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da (patch) | |
tree | fc3c799bece509682b712f6e42e2816059c83c7a /src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc | |
parent | Makefile: No need to remove non-generated *.mo files (diff) | |
download | euandre.org-61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da.tar.gz euandre.org-61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da.tar.xz |
src/content/en/: Unpluralize collection names
Diffstat (limited to 'src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc')
-rw-r--r-- | src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc b/src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc deleted file mode 100644 index 184ce97..0000000 --- a/src/content/en/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)); ----- |