UNPKG
the-moon
Version:
latest (1.1.0)
1.1.0
1.0.0
0.0.0
🌕 Show me the moon
omrilotan.com/mono/the-moon/
omrilotan/mono
the-moon
/
lib
/
word
/
index.js
12 lines
(11 loc)
•
257 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
/** * Convert kebab case to capitalised words *
@param
{
String
} text kebab case word combinations *
@return
{
String
}
Words
*/
module
.
exports
=
text
=>
text .
split
(
'-'
) .
map
(
word
=>
word.
charAt
(
0
).
toUpperCase
() + word.
slice
(
1
) ) .
join
(
' '
);