Fix linter errors

This commit is contained in:
Sergey Papushin
2020-04-16 18:53:43 -05:00
parent ec2dbb72ee
commit b3003e6419
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ const gameIdToCategoriesPromises: Map<string, Promise<Category[]>> = new Map();
const gameIdToGameInfoMap: Map<string, Game> = new Map();
const gameIdToGameInfoPromises: Map<string, Promise<Game>> = new Map();
const gameAndCategoryToLeaderboardPromises: Map<string, Promise<void>> = new Map();
const gameAndCategoryToLeaderboardMap: Map<string, Array<Run<PlayersEmbedded>>> = new Map();
const gameAndCategoryToLeaderboardMap: Map<string, Run<PlayersEmbedded>[]> = new Map();
let gameListPromise: Option<Promise<void>> = null;
let platformListPromise: Option<Promise<void>> = null;
let regionListPromise: Option<Promise<void>> = null;
@@ -61,7 +61,7 @@ export function getRegions(): Map<string, string> {
return regionList;
}
export function getLeaderboard(gameName: string, categoryName: string): Array<Run<PlayersEmbedded>> | undefined {
export function getLeaderboard(gameName: string, categoryName: string): Run<PlayersEmbedded>[] | undefined {
const key = JSON.stringify({ gameName, categoryName });
return gameAndCategoryToLeaderboardMap.get(key);
}
+4 -4
View File
@@ -148,10 +148,10 @@ export interface Record {
run: Run,
}
export type PlayersNotEmbedded = Array<PlayerUserRef | PlayerGuest>;
export type PlayersNotEmbedded = (PlayerUserRef | PlayerGuest)[];
export interface PlayersEmbedded {
data: Array<PlayerUser | PlayerGuest>,
data: (PlayerUser | PlayerGuest)[],
}
export interface Run<PlayerEmbedding = PlayersNotEmbedded> {
@@ -314,7 +314,7 @@ async function executePaginatedRequest<T>(uri: string): Promise<Page<T>> {
return new Page(data as T[], next);
}
export async function getGame(gameId: string, embeds?: Array<"variables">): Promise<Game> {
export async function getGame(gameId: string, embeds?: "variables"[]): Promise<Game> {
const parameters = [];
if (embeds !== undefined) {
parameters.push(`embed=${embeds.join(",")}`);
@@ -349,7 +349,7 @@ export async function getCategories(gameId: string): Promise<Category[]> {
export async function getLeaderboard(
gameId: string,
categoryId: string,
embeds?: Array<"players">,
embeds?: "players"[],
): Promise<Leaderboard> {
const parameters = [];
if (embeds !== undefined) {