@@ -127,21 +127,21 @@ export const createClient = (config: Config = {}): Client => {
127127
128128 const kyOptions : KyOptions = {
129129 body : validBody as BodyInit ,
130- ...( opts . cache ? { cache : opts . cache } : { } ) ,
131- ...( opts . credentials ? { credentials : opts . credentials } : { } ) ,
132- ...( opts . headers ? { headers : opts . headers } : { } ) ,
133- ...( opts . integrity ? { integrity : opts . integrity } : { } ) ,
134- ...( opts . keepalive ? { keepalive : opts . keepalive } : { } ) ,
135- ...( opts . method ? { method : opts . method } : { } ) ,
136- ...( opts . mode ? { mode : opts . mode } : { } ) ,
137- redirect : opts . redirect || 'follow' ,
138- ...( opts . referrer ? { referrer : opts . referrer } : { } ) ,
139- ...( opts . referrerPolicy ? { referrerPolicy : opts . referrerPolicy } : { } ) ,
140- ...( opts . signal ? { signal : opts . signal } : { } ) ,
130+ ...( opts . cache !== undefined ? { cache : opts . cache } : { } ) ,
131+ ...( opts . credentials !== undefined ? { credentials : opts . credentials } : { } ) ,
132+ ...( opts . headers !== undefined ? { headers : opts . headers } : { } ) ,
133+ ...( opts . integrity !== undefined ? { integrity : opts . integrity } : { } ) ,
134+ ...( opts . keepalive !== undefined ? { keepalive : opts . keepalive } : { } ) ,
135+ ...( opts . method !== undefined ? { method : opts . method } : { } ) ,
136+ ...( opts . mode !== undefined ? { mode : opts . mode } : { } ) ,
137+ redirect : opts . redirect ?? 'follow' ,
138+ ...( opts . referrer !== undefined ? { referrer : opts . referrer } : { } ) ,
139+ ...( opts . referrerPolicy !== undefined ? { referrerPolicy : opts . referrerPolicy } : { } ) ,
140+ ...( opts . signal !== undefined ? { signal : opts . signal } : { } ) ,
141141 throwHttpErrors : opts . throwOnError ?? false ,
142- ...( opts . timeout ? { timeout : opts . timeout } : { } ) ,
143- retry : opts . retry ?? 2 ,
142+ ...( opts . timeout !== undefined ? { timeout : opts . timeout } : { } ) ,
144143 ...opts . kyOptions ,
144+ retry : opts . retry ?? opts . kyOptions ?. retry ?? 2 ,
145145 } ;
146146
147147 let request = new Request ( url , {
0 commit comments