You've already forked tf2wikipricing
lint: var to let/const
This commit is contained in:
@@ -2,14 +2,14 @@ import { conversion_ref_usd } from '../config';
|
||||
import { $T } from './localization'
|
||||
|
||||
function toFixed(num: number, fixed: number) {
|
||||
var re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
|
||||
const re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
|
||||
return num.toString().match(re)[0];
|
||||
}
|
||||
|
||||
export function formatPrice(keys: number, metal: number, keyPrice: number, locale: string = 'en') {
|
||||
const formattedKeys = +(keys + (metal / keyPrice)).toFixed(2)
|
||||
|
||||
var output: string = ''
|
||||
let output: string = ''
|
||||
if(keys > 0) {
|
||||
output += (formattedKeys == 1.0 ? $T("%@ key") : $T("%@ keys")).replace('%@', formattedKeys.toLocaleString(locale))
|
||||
} else {
|
||||
|
||||
@@ -30,7 +30,7 @@ export function $T(s: string, locale?: Intl.LocalesArgument): string {
|
||||
}
|
||||
|
||||
export function extractLocaleFromURL(url: string): string {
|
||||
var split = url.substring(url.indexOf("/wiki/") + "/wiki/".length);
|
||||
const split = url.substring(url.indexOf("/wiki/") + "/wiki/".length);
|
||||
if (split.indexOf('/') != -1) {
|
||||
// Remove language suffix e.g. `/es`
|
||||
return split.substring(split.indexOf('/') + 1);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
declare var __PRODUCTION: boolean;
|
||||
declare var __EXTENSION_NAME: string;
|
||||
declare let __EXTENSION_NAME: string;
|
||||
const logHeader = `[${__EXTENSION_NAME}] `;
|
||||
|
||||
/** `console.debug` with header; automatically NO-OP on production build */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function extractPageTitleFromURL(url: string): string {
|
||||
var split = url.substring(url.indexOf("/wiki/") + "/wiki/".length);
|
||||
let split = url.substring(url.indexOf("/wiki/") + "/wiki/".length);
|
||||
if (split.indexOf('/') != -1) {
|
||||
// Remove language suffix (/es)
|
||||
split = split.substring(0, split.indexOf('/'));
|
||||
|
||||
Reference in New Issue
Block a user