mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
10 lines
265 B
JavaScript
10 lines
265 B
JavaScript
export function format(str = ""){
|
|
if(str.length === 0) return str;
|
|
return str.split("_")
|
|
.map((word, index) => {
|
|
|
|
if(index != 0) return word;
|
|
return word[0].toUpperCase() + word.substring(1);
|
|
})
|
|
.join(" ");
|
|
}
|