Use const variables when applicable

This commit is contained in:
2019-11-17 18:25:14 +09:00
parent 454e8572e3
commit 878f1913e3
39 changed files with 405 additions and 403 deletions

View File

@ -1,6 +1,6 @@
export function uploadWithProgress(url, options: RequestInit, onProgress: ((ev: ProgressEvent) => any) | null): Promise<string> {
return new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest()
const xhr = new XMLHttpRequest()
xhr.onload = () => {
if(xhr.status >= 400) {
@ -21,7 +21,7 @@ export function uploadWithProgress(url, options: RequestInit, onProgress: ((ev:
xhr.open(options.method || "GET", url, true)
if(options.headers) {
for(let key in options.headers) {
for(const key in options.headers) {
xhr.setRequestHeader(key, options.headers[key])
}
}