feat: switched to Node module resolution

This commit is contained in:
TresAbhi committed 2023-07-11 19:54:57 +00:00
1 parent 21158e9081
commit 1d4ac2f133
108 files changed
+541 -533

No files matched your search

+1 -1
View File
@@ -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 -1
View File
@@ -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) {
+4 -4
View File
@@ -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)) {
+5 -5
View File
@@ -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>(
+2 -2
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
import throwError from '../node/throwError.js';
import throwError from '../node/throwError';
export type WargamingResponse<Data extends object> =
| {
+4 -4
View File
@@ -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';
+4 -4
View File
@@ -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';
+2 -2
View File
@@ -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 -1
View File
@@ -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;
+2 -2
View File
@@ -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) => {