From b5a3ec2f86ffe1a69eb8af966e55c7dc1d0b950f Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 16 Apr 2018 21:41:37 +0200 Subject: [PATCH] Minor changes --- scripts/Utils/fetchWithProgress.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) }) }