Files
Compass/old/lib/format.ts
2025-08-27 21:30:05 +02:00

12 lines
251 B
TypeScript

function capitalizeOne(str: string) {
if (!str) return "";
return str[0].toUpperCase() + str.slice(1).toLowerCase();
}
export function capitalize(str: string) {
return str
.split(" ")
.map(word => capitalizeOne(word))
.join(" ");
}