mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: replace var usage with let/const (#7064)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user