mirror of https://github.com/lidarr/Lidarr
12 lines
219 B
JavaScript
12 lines
219 B
JavaScript
|
function titleCase(input) {
|
||
|
if (!input) {
|
||
|
return '';
|
||
|
}
|
||
|
|
||
|
return input.replace(/\w\S*/g, (match) => {
|
||
|
return match.charAt(0).toUpperCase() + match.substr(1).toLowerCase();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export default titleCase;
|