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

@@ -8,19 +8,19 @@
/**
* Gets a value indicating if the app is running on the Android platform.
*/
export var isAndroid: boolean;
export const isAndroid: boolean;
/**
* Gets a value indicating if the app is running on the iOS platform.
*/
export var isIOS: boolean;
export const isIOS: boolean;
/*
* Enum holding platform names.
*/
export module platformNames {
export var android: string;
export var ios: string;
export const android: string;
export const ios: string;
}
/*
@@ -119,10 +119,10 @@ export module screen {
/**
* Gets information about the main screen of the current device.
*/
export var mainScreen: ScreenMetrics;
export const mainScreen: ScreenMetrics;
}
/**
* Gets the current device information.
*/
export var device: Device;
export const device: Device;

View File

@@ -62,9 +62,9 @@ class Device implements DeviceDefinition {
}
get uuid(): string {
var userDefaults = NSUserDefaults.standardUserDefaults;
var uuid_key = "TNSUUID";
var app_uuid = userDefaults.stringForKey(uuid_key);
const userDefaults = NSUserDefaults.standardUserDefaults;
const uuid_key = "TNSUUID";
let app_uuid = userDefaults.stringForKey(uuid_key);
if (!app_uuid) {
app_uuid = NSUUID.UUID().UUIDString;
@@ -77,7 +77,7 @@ class Device implements DeviceDefinition {
get language(): string {
if (!this._language) {
var languages = NSLocale.preferredLanguages;
const languages = NSLocale.preferredLanguages;
this._language = languages[0];
}