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