mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: switched to Node module resolution
This commit is contained in:
1 parent
21158e9081
commit
1d4ac2f133
108 files changed
+541
-533
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import { AllStats } from '../../types/accountInfo';
|
||||
|
||||
/**
|
||||
* Formula from https://web.archive.org/web/20190105064817/http://wiki.wnefficiency.net/pages/WN8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import { AllStats } from '../../types/accountInfo';
|
||||
|
||||
export default function diffStats(stats1: AllStats, stats2: AllStats) {
|
||||
function diff(value: (allStats: AllStats) => number) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand.js';
|
||||
import throwError from '../node/throwError.js';
|
||||
import listClans from './listClans.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand';
|
||||
import throwError from '../node/throwError';
|
||||
import listClans from './listClans';
|
||||
|
||||
export default async function getBlitzClan(clan: string) {
|
||||
if (serverAndIdPattern.test(clan)) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers.js';
|
||||
import { TanksStats } from '../../types/tanksStats.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import throwError from '../node/throwError.js';
|
||||
import getWargamingResponse from './getWargamingResponse.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers';
|
||||
import { TanksStats } from '../../types/tanksStats';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import throwError from '../node/throwError';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export default async function getTankStats(server: BlitzServer, id: number) {
|
||||
const tankStats = await getWargamingResponse<TanksStats>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TreeType } from '../../components/Tanks/index.js';
|
||||
import { tankopedia } from './tankopedia.js';
|
||||
import { TreeType } from '../../components/Tanks';
|
||||
import { tankopedia } from './tankopedia';
|
||||
|
||||
export default async function getTreeType(id: number) {
|
||||
const entry = (await tankopedia)[id];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Percentile } from '../../constants/percentiles.js';
|
||||
import { Percentile } from '../../constants/percentiles';
|
||||
|
||||
export const WN8_PERCENTILES: [number, Percentile][] = [
|
||||
[0, Percentile.VeryBad],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import throwError from '../node/throwError.js';
|
||||
import throwError from '../node/throwError';
|
||||
|
||||
export type WargamingResponse<Data extends object> =
|
||||
| {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { Clan, ClanList } from '../../types/clanList.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import getWargamingResponse from './getWargamingResponse.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { Clan, ClanList } from '../../types/clanList';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export type ClanListWithServer = (Clan & {
|
||||
server: 'com' | 'eu' | 'asia';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { Account, AccountList } from '../../types/accountList.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import getWargamingResponse from './getWargamingResponse.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { Account, AccountList } from '../../types/accountList';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export type AccountListWithServer = (Account & {
|
||||
server: 'com' | 'eu' | 'asia';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { go } from 'fuzzysort';
|
||||
import throwError from '../node/throwError.js';
|
||||
import { TANKS, tankopedia } from './tankopedia.js';
|
||||
import throwError from '../node/throwError';
|
||||
import { TANKS, tankopedia } from './tankopedia';
|
||||
|
||||
export default async function resolveTankId(tank: string) {
|
||||
const number = parseInt(tank);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tankopedia } from './tankopedia.js';
|
||||
import { tankopedia } from './tankopedia';
|
||||
|
||||
export default async function resolveTankName(tankId: number) {
|
||||
const tankopediaName = (await tankopedia)[tankId]?.name;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import { emptyAllStats } from '../blitzstars/getDiffedTankStats.js';
|
||||
import { AllStats } from '../../types/accountInfo';
|
||||
import { emptyAllStats } from '../blitzstars/getDiffedTankStats';
|
||||
|
||||
export default function sumStats(allStatsCollection: AllStats[]) {
|
||||
return allStatsCollection.reduce((accumulated, current) => {
|
||||
|
||||
Reference in new issue
Block a user