This commit is contained in:
Benjamin Toby
2024-12-09 16:50:52 +01:00
parent b037cec100
commit 20959c3580
6 changed files with 16 additions and 7 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
import { AuthCsrfHeaderName } from "@/server-client-shared/types/admin/auth";
import _ from "lodash";
type FetchApiOptions = {
@@ -18,7 +17,7 @@ type FetchApiOptions = {
};
type FetchHeader = HeadersInit & {
[key in AuthCsrfHeaderName]?: string | null;
[key: string]: string | null;
};
export type FetchApiReturn = {
@@ -0,0 +1,9 @@
export default function lowerToTitleCase(str: string) {
return str
.replace(/_|-/g, " ")
.split(" ")
.map(
(word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
)
.join(" ");
}