fix: make dasherize trim first

This commit is contained in:
Oliver Eyton-Williams
2019-09-26 18:08:17 +02:00
committed by mrugesh
parent 3dc4e5897d
commit f159645810
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
exports.dasherize = function dasherize(name) {
return ('' + name)
.toLowerCase()
.trim()
.replace(/\s/g, '-')
.replace(/[^a-z\d\-.]/g, '');
};