'use strict';
function slugify(string, encode = false) {
const slug = string.trim().toLowerCase().match(/\w+/g).join('-');
return encode ? encodeURI(slug) : slug;
}
module.exports = slugify;