I find the title case conversion extremely useful. Especially how it leaves the words like "of" and "and" in lowercase.
I was hoping to code something similar but am stumped on how to handle these words. At first I thought of just using a simple RegEx to check for such trivial prepositions, but that is a brute force method, and I was interested in the creative code you may have employed.
Unfortunately, I have yet not been able to figure out what code is being used. From what I have seen, most of your cases are stored in /scripts/cases.js
which imports toTitleCase
from 'to-title-case'
. This is based on a work by Blake Embrey which has the following code:
return noCase(value, locale).replace(/^.| ./g, function (m) {
return upperCase(m, locale)
})