const toTitleCase = function(string) { if (typeof string !== 'string') { return string; } return string.replace(/./, (w) => w.toUpperCase()); }; export default toTitleCase;