13 lines
255 B
JavaScript
13 lines
255 B
JavaScript
import slugify from 'slugify';
|
|
/** Converts string to a slug form. */
|
|
export const slugifyString = str => {
|
|
return slugify(str, {
|
|
replacement: '-',
|
|
remove: /[#,&,+()$~%.'":*?<>{}]/g,
|
|
lower: true
|
|
});
|
|
};
|
|
|
|
export default {
|
|
slugifyString
|
|
} |