Closed btxtiger closed 2 years ago
This confused me, too. It's possible that this Issue is related.
Regardless, I wonder if you could add spaces before all capitalized letters first...
Maybe try something like this?
titleCase(sentenceCase('userSessions'.replace(/([A-Z])/, ' $1')))
I'm not sure I follow this issue, but it works for me: https://runkit.com/blakeembrey/62105d3771ff5600088d0b2d.
In that example of capitalCase
and titleCase
are working.
Oh, I think the complaint is that titleCase
doesn't automatically turn camel case into something else. That's expected behavior, you want capitalCase
(title case is for just turning text into a "title" according to basic English rules). That's why it's not included in change-case
at all.
Seems Title Case not working with a camelCase string. I needed to use
titleCase(sentenceCase('userSessions'))
to getUser Sessions
. Otherwise the output remains camelCase.