merge with dev

This commit is contained in:
Jorrin
2023-12-26 23:16:26 +01:00
parent 304ef68c5f
commit 65bbf28442
9 changed files with 40 additions and 46 deletions

View File

@@ -35,7 +35,6 @@ export function makeFetcher(fetcher: Fetcher): UseableFetcher {
baseUrl: ops?.baseUrl ?? '',
readHeaders: ops?.readHeaders ?? [],
body: ops?.body,
returnRaw: ops?.returnRaw ?? false,
});
};
const output: UseableFetcher = async (url, ops) => (await newFetcher(url, ops)).body;

View File

@@ -29,10 +29,6 @@ export function makeStandardFetcher(f: FetchLike): Fetcher {
body: seralizedBody.body,
});
if (ops.returnRaw) {
return res;
}
let body: any;
const isJson = res.headers.get('content-type')?.includes('application/json');
if (isJson) body = await res.json();

View File

@@ -7,7 +7,6 @@ export type FetcherOptions = {
method?: 'HEAD' | 'GET' | 'POST';
readHeaders?: string[];
body?: Record<string, any> | string | FormData | URLSearchParams;
returnRaw?: boolean;
};
// Version of the options that always has the defaults set
@@ -18,7 +17,6 @@ export type DefaultedFetcherOptions = {
headers: Record<string, string>;
query: Record<string, string>;
method: 'HEAD' | 'GET' | 'POST';
returnRaw: boolean;
readHeaders: string[];
};