lint: var to let/const

This commit is contained in:
xenticore
2025-04-24 17:38:02 -04:00
parent d71cfcd0d7
commit df3b40fbdd
11 changed files with 44 additions and 45 deletions

View File

@@ -14,8 +14,8 @@ export function checkAustraliumVariant(defindex: number): boolean {
export declare const __VERSION__: string;
function isDateAfterOneDay(date1: Date, date2: Date): boolean {
var diff = date2.getTime() - date1.getTime();
var diffDays = Math.round(diff / (1000 * 3600 * 24));
const diff = date2.getTime() - date1.getTime();
const diffDays = Math.round(diff / (1000 * 3600 * 24));
return diffDays > 1;
}
@@ -119,8 +119,8 @@ export async function wipeSchema(): Promise<void> {
}
export async function prepareSchema(): Promise<ItemSchema> {
var needsUpdate: Boolean = false
var itemSchema: ItemSchema | null = null
let needsUpdate: boolean = false
let itemSchema: ItemSchema | null = null
const storedVersion: string | null = await getStorageValue(storage_version, null)
if(!storedVersion || !semver.valid(storedVersion)) {
@@ -150,14 +150,14 @@ export async function prepareSchema(): Promise<ItemSchema> {
if (response.ok) {
await setStorageValue(storage_lastUpdateTime, new Date().getTime());
var cacheItems = {}
const cacheItems = {}
var responseItems: any[] = await response.json()
const responseItems: any[] = await response.json()
// We want to keep the keys `defindex`, `item_name`, and `attributes`
responseItems.forEach((item: any) => {
const defindex: number = item['defindex']
var tradable: Boolean = true
let tradable: boolean = true
try {
if(item['attributes'] != null) {
if(item['attributes'].find((attribute: {}) => (attribute as any)['class'] == "cannot_trade")) {
@@ -169,7 +169,7 @@ export async function prepareSchema(): Promise<ItemSchema> {
log(item)
}
var canKillstreakify: Boolean = false
let canKillstreakify: boolean = false
try {
if(item['capabilities'] != null) {
if(item['capabilities']['can_killstreakify'] != null && item['capabilities']['can_killstreakify'] == true) {