|
|
@ -14,7 +14,7 @@ export const slugify = (str: string): string => {
|
|
|
|
.replace(rSpecial, '-')
|
|
|
|
.replace(rSpecial, '-')
|
|
|
|
// Remove continuos separators
|
|
|
|
// Remove continuos separators
|
|
|
|
.replace(/\-{2,}/g, '-')
|
|
|
|
.replace(/\-{2,}/g, '-')
|
|
|
|
// Remove prefixing and trailing separtors
|
|
|
|
// Remove prefixing and trailing separators
|
|
|
|
.replace(/^\-+|\-+$/g, '')
|
|
|
|
.replace(/^\-+|\-+$/g, '')
|
|
|
|
// ensure it doesn't start with a number (#121)
|
|
|
|
// ensure it doesn't start with a number (#121)
|
|
|
|
.replace(/^(\d)/, '_$1')
|
|
|
|
.replace(/^(\d)/, '_$1')
|
|
|
|