mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 09:37:55 +08:00
11 lines
265 B
JavaScript
11 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(" ");
|
|
}
|