mirror of
https://github.com/Radarr/Radarr
synced 2026-01-04 14:42:26 +01:00
13 lines
241 B
JavaScript
13 lines
241 B
JavaScript
const regex = /\b\w+/g;
|
|
|
|
function titleCase(input) {
|
|
if (!input) {
|
|
return '';
|
|
}
|
|
|
|
return input.replace(regex, (match) => {
|
|
return match.charAt(0).toUpperCase() + match.substr(1).toLowerCase();
|
|
});
|
|
}
|
|
|
|
export default titleCase;
|