mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 17:33:26 +00:00
merge with dev
This commit is contained in:
@@ -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;
|
||||
|
@@ -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();
|
||||
|
@@ -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[];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user