diff --git a/scripts/Utils/fetchWithProgress.ts b/scripts/Utils/fetchWithProgress.ts index da382475..b2e990b3 100644 --- a/scripts/Utils/fetchWithProgress.ts +++ b/scripts/Utils/fetchWithProgress.ts @@ -1,10 +1,10 @@ -export function fetchWithProgress(url, opts: RequestInit, onProgress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null): Promise { +export function fetchWithProgress(url, options: RequestInit, onProgress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null): Promise { return new Promise((resolve, reject) => { let xhr = new XMLHttpRequest() - xhr.open(opts.method || "GET", url) + xhr.open(options.method || "GET", url) - for(let k in opts.headers || {}) { - xhr.setRequestHeader(k, opts.headers[k]) + for(let k in options.headers || {}) { + xhr.setRequestHeader(k, options.headers[k]) } xhr.onload = e => resolve(xhr.responseText) @@ -14,6 +14,6 @@ export function fetchWithProgress(url, opts: RequestInit, onProgress: ((this: XM xhr.upload.onprogress = onProgress } - xhr.send(opts.body) + xhr.send(options.body) }) }