You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
var regUpperCase = /([A-Z])/g; |
|
var regSeparator = /[_.\- ]+/g; |
|
var regTrim = /(^-)|(-$)/g; |
|
exports = function(str) { |
|
str = str |
|
.replace(regUpperCase, '-$1') |
|
.toLowerCase() |
|
.replace(regSeparator, '-') |
|
.replace(regTrim, ''); |
|
return str.split('-'); |
|
}; |
|
|
|
module.exports = exports;
|
|
|