Updates
This commit is contained in:
@@ -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(" ");
|
||||
}
|
||||
Reference in New Issue
Block a user