1
1
mirror of https://github.com/primer/css.git synced 2024-12-13 16:15:44 +03:00
css/tools/generator-primer-module/app/lib/capitalize.js
2017-10-10 11:50:55 -07:00

6 lines
145 B
JavaScript

module.exports = str => {
return str.split("-")
.map(word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase())
.join(" ")
}