aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/with-changesets/packages/acme-utils/src/toSlug.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/with-changesets/packages/acme-utils/src/toSlug.ts')
-rw-r--r--examples/with-changesets/packages/acme-utils/src/toSlug.ts18
1 files changed, 0 insertions, 18 deletions
diff --git a/examples/with-changesets/packages/acme-utils/src/toSlug.ts b/examples/with-changesets/packages/acme-utils/src/toSlug.ts
deleted file mode 100644
index 6aec61c..0000000
--- a/examples/with-changesets/packages/acme-utils/src/toSlug.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Return a slugified copy of a string.
- *
- * @param {string} str The string to be slugified
- * @return {string} The slugified string.
- */
-export function toSlug(str: string): string {
- let s = str;
- if (!s) {
- return "";
- }
- s = s.toLowerCase().trim();
- s = s.replace(/ & /g, " and ");
- s = s.replace(/[ ]+/g, "-");
- s = s.replace(/[-]+/g, "-");
- s = s.replace(/[^a-z0-9-]+/g, "");
- return s;
-}