aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index b1cd120..ed75d2f 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -34,3 +34,10 @@ export function formatCentsToUSD(cents: number): string {
currency: 'USD',
}).format(cents / 100)
}
+
+export function titleCase(str: string): string {
+ return str
+ .split(" ")
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
+ .join(" ");
+} \ No newline at end of file