3 function slugger(text
) {
4 const trimmedText
= text
.trim();
5 const parts
= trimmedText
.split(/[^\p{L}\d_]+/u);
8 .filter(function(part
) {
9 return part
.length
> 0;
14 function isValid(text
) {
15 return /^[\p{L}\d_-]+$/u.test(text
);
18 module
.exports
= slugger
;
19 module
.exports
.isValid
= isValid
;