2024-10-06 11:36:54 +00:00
|
|
|
import slugify from 'slugify';
|
2023-02-04 16:27:15 +00:00
|
|
|
/** Converts string to a slug form. */
|
2024-10-06 11:36:54 +00:00
|
|
|
export const slugifyString = str => {
|
2023-02-04 16:27:15 +00:00
|
|
|
return slugify(str, {
|
|
|
|
replacement: '-',
|
|
|
|
remove: /[#,&,+()$~%.'":*?<>{}]/g,
|
|
|
|
lower: true
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2024-10-06 11:36:54 +00:00
|
|
|
export default {
|
2023-02-04 16:27:15 +00:00
|
|
|
slugifyString
|
|
|
|
}
|