File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ function fetchFactory<Paths>(options?: InitParameters) {
6464}
6565
6666function buildInit (
67- defaultInit : RequestInit ,
67+ defaultInit : Omit < RequestInit , "headers" > ,
6868 options : AllFetchOptions ,
6969 headers : HeadersInit
7070) : RequestInit {
Original file line number Diff line number Diff line change 11export function buildHeaders (
22 resolvedPath : string ,
33 defaultHeaders ?:
4- | RequestInitHeaders
5- | ( ( pathInfo : { resolvedPath : string } ) => RequestInitHeaders ) ,
6- headers ?: RequestInitHeaders
4+ | HeadersInit
5+ | ( ( pathInfo : { resolvedPath : string } ) => HeadersInit ) ,
6+ headers ?: HeadersInit
77) {
88 const resolvedDefaultHeaders =
99 typeof defaultHeaders === "function"
@@ -34,5 +34,3 @@ function headerToEntries(
3434
3535 return Object . entries ( headers ) ;
3636}
37-
38- type RequestInitHeaders = Headers | [ string , string ] [ ] | Record < string , string > ;
Original file line number Diff line number Diff line change 11export type InitParameters = {
22 baseUrl ?: string ;
3- defaultInit ?: Omit < RequestInit , "method" > ;
3+ defaultInit ?: Omit < RequestInit , "method" | "headers" > & {
4+ headers :
5+ | HeadersInit
6+ | ( ( pathInfo : { resolvedPath : string } ) => HeadersInit ) ;
7+ } ;
48 fetchMethod ?: typeof fetch ;
59 parameterSerialization ?: {
610 path ?: { explode ?: boolean ; style ?: PathSerializationStyle } ;
You can’t perform that action at this time.
0 commit comments