summaryrefslogtreecommitdiff
path: root/src2/core/utils/slug.js
diff options
context:
space:
mode:
Diffstat (limited to 'src2/core/utils/slug.js')
-rw-r--r--src2/core/utils/slug.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/src2/core/utils/slug.js b/src2/core/utils/slug.js
deleted file mode 100644
index 0a7d30fc..00000000
--- a/src2/core/utils/slug.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import toTitleCase from './toTitleCase';
-
-const createSlug = (name, id) => {
- let slug = name?.trim().replace(new RegExp(/[^A-Za-z0-9]/, 'g'), '-').toLowerCase() + '-' + id;
- let splitSlug = slug.split('-');
- let filterSlugFromEmptyChar = splitSlug.filter(x => x != '');
- return filterSlugFromEmptyChar.join('-');
-}
-
-const getIdFromSlug = (slug) => {
- let id = slug.split('-');
- return id[id.length-1];
-}
-
-const getNameFromSlug = (slug) => {
- let name = slug.split('-');
- name.pop();
- return toTitleCase(name.join(' '));
-}
-
-export {
- createSlug,
- getIdFromSlug,
- getNameFromSlug
-}; \ No newline at end of file