UNPKG

statistic_tracker

Version:

A Statistic Tracker for Apex Legends, Cs:Go, Fortnite and Overwatch

21 lines (20 loc) 754 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const functions_1 = __importDefault(require("../functions")); module.exports = class { constructor(apiKey) { this.apiKey = apiKey; } getStats(query, game) { if (!game) throw Error("No game provided"); game = game.toLowerCase(); if (!["apex", "fortnite", "overwatch", "csgo"].includes(game)) throw Error("Non valid game"); if (["apex", "fortnite", "csgo"].includes(game) && !this.apiKey) throw Error("No/Invalid api key"); return functions_1.default[game](query, this.apiKey); } };