summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-04 13:39:20 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-04 13:39:20 +0100
commitc6285083865e3dbbad64446b92d69ce292e73134 (patch)
tree2fdc9af23773d851f98003afcf1c4e036291535c /src/utils
parenta4ae2783362a79fd9f541a0f45c41de8757aa66e (diff)
refactor: improve regex readability by grouping parts
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/helpers/slugify.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/helpers/slugify.ts b/src/utils/helpers/slugify.ts
index 37619bc..55ff583 100644
--- a/src/utils/helpers/slugify.ts
+++ b/src/utils/helpers/slugify.ts
@@ -14,5 +14,5 @@ export const slugify = (text: string) => {
.replace(/\s+/g, '-')
.replace(/[^\w\-]+/g, '-')
.replace(/\-\-+/g, '-')
- .replace(/^-|-$/g, '');
+ .replace(/(^-)|(-$)/g, '');
};