mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-10 00:08:22 +03:00
Change /:ugpt to retrieve all ranking infos
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import crypto from "crypto";
|
||||
import { ServerTypeInfo } from "lib/setup/config";
|
||||
import { Game, Playtypes, GetGameConfig } from "tachi-common";
|
||||
import { Game, Playtypes, GetGameConfig, GamePTConfig } from "tachi-common";
|
||||
|
||||
// https://github.com/sindresorhus/escape-string-regexp/blob/main/index.js
|
||||
// the developer of this has migrated everything to Force ES6 style modules,
|
||||
@@ -69,6 +69,13 @@ export function IsValidPlaytype(game: Game, str: string): str is Playtypes[Game]
|
||||
return GetGameConfig(game).validPlaytypes.includes(str as Playtypes[Game]);
|
||||
}
|
||||
|
||||
export function IsValidScoreAlg(
|
||||
gptConfig: GamePTConfig,
|
||||
str: unknown
|
||||
): str is GamePTConfig["scoreRatingAlgs"][0] {
|
||||
return gptConfig.scoreRatingAlgs.includes(str as GamePTConfig["scoreRatingAlgs"][0]);
|
||||
}
|
||||
|
||||
export function IsString(val: unknown): val is string {
|
||||
return typeof val === "string";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user