diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-04 13:39:20 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-04 13:39:20 +0100 |
| commit | c6285083865e3dbbad64446b92d69ce292e73134 (patch) | |
| tree | 2fdc9af23773d851f98003afcf1c4e036291535c /src/utils | |
| parent | a4ae2783362a79fd9f541a0f45c41de8757aa66e (diff) | |
refactor: improve regex readability by grouping parts
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/helpers/slugify.ts | 2 |
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, ''); }; |
