File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function checkDuplicateFileNames(files: any[]) {
3939}
4040
4141async function fetchWithTimeout (
42- resource : string ,
42+ endpointURL : string ,
4343 options : FetchOptions
4444) : Promise < Response > {
4545 const { timeout = 8000 , onProgress, ...rest } = options
@@ -51,7 +51,7 @@ async function fetchWithTimeout(
5151 if ( onProgress && rest . body instanceof FormData ) {
5252 return new Promise < Response > ( ( resolve , reject ) => {
5353 const xhr = new XMLHttpRequest ( )
54- xhr . open ( rest . method || 'GET' , resource )
54+ xhr . open ( rest . method || 'GET' , endpointURL )
5555
5656 if ( rest . headers ) {
5757 if ( rest . headers instanceof Headers ) {
@@ -114,7 +114,7 @@ async function fetchWithTimeout(
114114 }
115115 } )
116116 } else {
117- const response = await fetch ( resource , {
117+ const response = await fetch ( endpointURL , {
118118 ...rest ,
119119 signal : controller . signal ,
120120 } )
@@ -127,18 +127,10 @@ async function fetchWithTimeout(
127127 }
128128}
129129
130- async function retryFetch (
131- resource : string ,
132- options : FetchOptions ,
133- retries = 3
134- ) : Promise < Response > {
135- return await fetchWithTimeout ( resource , options )
136- }
137-
138130export {
139131 isCID ,
140132 isPrivateKey ,
141133 addressValidator ,
142134 checkDuplicateFileNames ,
143- retryFetch ,
135+ fetchWithTimeout ,
144136}
You can’t perform that action at this time.
0 commit comments