refactor: replace var usage with let/const (#7064)

This commit is contained in:
Manol Donev
2019-03-25 18:09:14 +02:00
committed by GitHub
parent 34fe24732d
commit b436ecde36
75 changed files with 1093 additions and 1085 deletions

View File

@@ -6,5 +6,5 @@
//@private
import * as http from "..";
export var request: (options: http.HttpRequestOptions) => Promise<http.HttpResponse>;
export const request: (options: http.HttpRequestOptions) => Promise<http.HttpResponse>;
export function addHeader(headers: http.Headers, key: string, value: string): void;

View File

@@ -7,7 +7,7 @@ export function getString(arg: any): Promise<string> {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(r => {
try {
var str = r.content.toString();
const str = r.content.toString();
resolve(str);
} catch (e) {
reject(e);
@@ -21,7 +21,7 @@ export function getJSON<T>(arg: any): Promise<T> {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(r => {
try {
var json = r.content.toJSON();
const json = r.content.toJSON();
resolve(json);
} catch (e) {
reject(e);
@@ -50,7 +50,7 @@ export function getFile(arg: any, destinationFilePath?: string): Promise<any> {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(r => {
try {
var file = r.content.toFile(destinationFilePath);
const file = r.content.toFile(destinationFilePath);
resolve(file);
} catch (e) {
reject(e);