Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ramda Title Case
import R from 'ramda';
const capitalize =
R.converge(
R.concat(),
[
R.compose(
R.toUpper,
R.head
),
R.tail,
]
);
const toTitleCase =
R.compose(
R.join(' '),
R.map(capitalize),
R.split(' ')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.