diff options
Diffstat (limited to 'node_modules/swup/src/helpers/classify.ts')
| -rwxr-xr-x | node_modules/swup/src/helpers/classify.ts | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/node_modules/swup/src/helpers/classify.ts b/node_modules/swup/src/helpers/classify.ts deleted file mode 100755 index 3d9ecec6..00000000 --- a/node_modules/swup/src/helpers/classify.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** Turn a string into a slug by lowercasing and replacing whitespace. */ -export const classify = (text: string, fallback?: string): string => { - const output = String(text) - .toLowerCase() - // .normalize('NFD') // split an accented letter in the base letter and the acent - // .replace(/[\u0300-\u036f]/g, '') // remove all previously split accents - .replace(/[\s/_.]+/g, '-') // replace spaces and _./ with '-' - .replace(/[^\w-]+/g, '') // remove all non-word chars - .replace(/--+/g, '-') // replace repeating '-' with single '-' - .replace(/^-+|-+$/g, ''); // trim '-' from edges - return output || fallback || ''; -}; |
