diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/swup/src/helpers/classify.ts | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
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 || ''; -}; |
