From f72e6877ebd5b7ea109b338209bf4cdb879a5ed3 Mon Sep 17 00:00:00 2001 From: zkldi Date: Wed, 14 Jul 2021 14:48:35 +0100 Subject: [PATCH] I'm a numpty who doesn't remember their own codebase --- common/js/config/static-config.d.ts | 3 +-- common/js/config/static-config.js | 11 +---------- common/js/config/static-config.js.map | 2 +- common/js/utils/util.d.ts | 3 ++- common/js/utils/util.js | 10 +++++++++- common/js/utils/util.js.map | 2 +- common/src/config/static-config.ts | 12 +----------- common/src/utils/util.ts | 12 +++++++++++- 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/common/js/config/static-config.d.ts b/common/js/config/static-config.d.ts index e04a4bad5..7ef6ba20e 100644 --- a/common/js/config/static-config.d.ts +++ b/common/js/config/static-config.d.ts @@ -1,4 +1,4 @@ -import { FileUploadImportTypes, IRImportTypes, APIImportTypes, ImportTypes, Game, Playtypes } from ".."; +import { FileUploadImportTypes, IRImportTypes, APIImportTypes, ImportTypes, Game } from ".."; export declare const fileImportTypes: FileUploadImportTypes[]; export declare const irImportTypes: IRImportTypes[]; export declare const apiImportTypes: APIImportTypes[]; @@ -12,4 +12,3 @@ export interface ServerConfig { export declare const KTCHI_CONFIG: ServerConfig; export declare const BTCHI_CONFIG: ServerConfig; export declare const OMNI_CONFIG: ServerConfig; -export declare function FormatGame(game: Game, playtype: Playtypes[Game]): string; diff --git a/common/js/config/static-config.js b/common/js/config/static-config.js index 8d9e4f242..e9aea68b3 100644 --- a/common/js/config/static-config.js +++ b/common/js/config/static-config.js @@ -1,7 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.FormatGame = exports.OMNI_CONFIG = exports.BTCHI_CONFIG = exports.KTCHI_CONFIG = exports.allSupportedGames = exports.allImportTypes = exports.apiImportTypes = exports.irImportTypes = exports.fileImportTypes = void 0; -const config_1 = require("./config"); +exports.OMNI_CONFIG = exports.BTCHI_CONFIG = exports.KTCHI_CONFIG = exports.allSupportedGames = exports.allImportTypes = exports.apiImportTypes = exports.irImportTypes = exports.fileImportTypes = void 0; exports.fileImportTypes = [ "file/eamusement-iidx-csv", "file/batch-manual", @@ -76,12 +75,4 @@ exports.OMNI_CONFIG = { supportedGames: exports.allSupportedGames, supportedImportTypes: exports.allImportTypes, }; -function FormatGame(game, playtype) { - const gameConfig = config_1.GetGameConfig(game); - if (gameConfig.validPlaytypes.length === 1) { - return gameConfig.name; - } - return `${gameConfig.name} (${playtype})`; -} -exports.FormatGame = FormatGame; //# sourceMappingURL=static-config.js.map \ No newline at end of file diff --git a/common/js/config/static-config.js.map b/common/js/config/static-config.js.map index 6ce24029a..0d4b3d6d8 100644 --- a/common/js/config/static-config.js.map +++ b/common/js/config/static-config.js.map @@ -1 +1 @@ -{"version":3,"file":"static-config.js","sourceRoot":"","sources":["../../src/config/static-config.ts"],"names":[],"mappings":";;;AAQA,qCAAyC;AAE5B,QAAA,eAAe,GAA4B;IACvD,0BAA0B;IAC1B,mBAAmB;IACnB,wBAAwB;IACxB,eAAe;IACf,mBAAmB;CACnB,CAAC;AAEW,QAAA,aAAa,GAAoB;IAC7C,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,cAAc;IACd,eAAe;IACf,QAAQ;CACR,CAAC;AAEW,QAAA,cAAc,GAAqB;IAC/C,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;CACd,CAAC;AAEW,QAAA,cAAc,GAAkB;IAC5C,GAAG,uBAAe;IAClB,GAAG,qBAAa;IAChB,GAAG,sBAAc;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAW;IACxC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,MAAM;IACN,KAAK;IACL,KAAK;IACL,UAAU;IACV,UAAU;IACV,KAAK;CACL,CAAC;AAQW,QAAA,YAAY,GAAiB;IACzC,IAAI,EAAE,YAAY;IAClB,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;IAC5E,oBAAoB,EAAE;QACrB,cAAc;QACd,cAAc;QACd,aAAa;QACb,cAAc;QACd,cAAc;QACd,cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,aAAa;QACb,oBAAoB;QACpB,eAAe;QACf,0BAA0B;QAC1B,wBAAwB;QACxB,eAAe;QACf,mBAAmB;KACnB;CACD,CAAC;AAEW,QAAA,YAAY,GAAiB;IACzC,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC9B,oBAAoB,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,CAAC;CACzF,CAAC;AAEW,QAAA,WAAW,GAAiB;IACxC,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,yBAAiB;IACjC,oBAAoB,EAAE,sBAAc;CACpC,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAU,EAAE,QAAyB;IAC/D,MAAM,UAAU,GAAG,sBAAa,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3C,OAAO,UAAU,CAAC,IAAI,CAAC;KACvB;IAED,OAAO,GAAG,UAAU,CAAC,IAAI,KAAK,QAAQ,GAAG,CAAC;AAC3C,CAAC;AARD,gCAQC"} \ No newline at end of file +{"version":3,"file":"static-config.js","sourceRoot":"","sources":["../../src/config/static-config.ts"],"names":[],"mappings":";;;AAUa,QAAA,eAAe,GAA4B;IACvD,0BAA0B;IAC1B,mBAAmB;IACnB,wBAAwB;IACxB,eAAe;IACf,mBAAmB;CACnB,CAAC;AAEW,QAAA,aAAa,GAAoB;IAC7C,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,cAAc;IACd,eAAe;IACf,QAAQ;CACR,CAAC;AAEW,QAAA,cAAc,GAAqB;IAC/C,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;CACd,CAAC;AAEW,QAAA,cAAc,GAAkB;IAC5C,GAAG,uBAAe;IAClB,GAAG,qBAAa;IAChB,GAAG,sBAAc;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAW;IACxC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,MAAM;IACN,KAAK;IACL,KAAK;IACL,UAAU;IACV,UAAU;IACV,KAAK;CACL,CAAC;AAQW,QAAA,YAAY,GAAiB;IACzC,IAAI,EAAE,YAAY;IAClB,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;IAC5E,oBAAoB,EAAE;QACrB,cAAc;QACd,cAAc;QACd,aAAa;QACb,cAAc;QACd,cAAc;QACd,cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,aAAa;QACb,oBAAoB;QACpB,eAAe;QACf,0BAA0B;QAC1B,wBAAwB;QACxB,eAAe;QACf,mBAAmB;KACnB;CACD,CAAC;AAEW,QAAA,YAAY,GAAiB;IACzC,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC9B,oBAAoB,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,CAAC;CACzF,CAAC;AAEW,QAAA,WAAW,GAAiB;IACxC,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,yBAAiB;IACjC,oBAAoB,EAAE,sBAAc;CACpC,CAAC"} \ No newline at end of file diff --git a/common/js/utils/util.d.ts b/common/js/utils/util.d.ts index 10b0092a6..347978480 100644 --- a/common/js/utils/util.d.ts +++ b/common/js/utils/util.d.ts @@ -1,2 +1,3 @@ -import { AnyChartDocument, Game } from ".."; +import { AnyChartDocument, Game, Playtypes } from ".."; export declare function FormatDifficulty(chart: AnyChartDocument, game: Game): string; +export declare function FormatGame(game: Game, playtype: Playtypes[Game]): string; diff --git a/common/js/utils/util.js b/common/js/utils/util.js index d5dd244d0..671460ffb 100644 --- a/common/js/utils/util.js +++ b/common/js/utils/util.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.FormatDifficulty = void 0; +exports.FormatGame = exports.FormatDifficulty = void 0; const config_1 = require("../config/config"); function FormatDifficulty(chart, game) { const gameConfig = config_1.GetGameConfig(game); @@ -10,4 +10,12 @@ function FormatDifficulty(chart, game) { return `${chart.difficulty}`; } exports.FormatDifficulty = FormatDifficulty; +function FormatGame(game, playtype) { + const gameConfig = config_1.GetGameConfig(game); + if (gameConfig.validPlaytypes.length === 1) { + return gameConfig.name; + } + return `${gameConfig.name} (${playtype})`; +} +exports.FormatGame = FormatGame; //# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/common/js/utils/util.js.map b/common/js/utils/util.js.map index 60e31448c..c9e7548e6 100644 --- a/common/js/utils/util.js.map +++ b/common/js/utils/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":";;;AACA,6CAAiD;AAEjD,SAAgB,gBAAgB,CAAC,KAAuB,EAAE,IAAU;IACnE,MAAM,UAAU,GAAG,sBAAa,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QACzC,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;KAC9D;IAED,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;AAC9B,CAAC;AAPD,4CAOC"} \ No newline at end of file +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":";;;AACA,6CAAiD;AAEjD,SAAgB,gBAAgB,CAAC,KAAuB,EAAE,IAAU;IACnE,MAAM,UAAU,GAAG,sBAAa,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QACzC,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;KAC9D;IAED,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;AAC9B,CAAC;AAPD,4CAOC;AAED,SAAgB,UAAU,CAAC,IAAU,EAAE,QAAyB;IAC/D,MAAM,UAAU,GAAG,sBAAa,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3C,OAAO,UAAU,CAAC,IAAI,CAAC;KACvB;IAED,OAAO,GAAG,UAAU,CAAC,IAAI,KAAK,QAAQ,GAAG,CAAC;AAC3C,CAAC;AARD,gCAQC"} \ No newline at end of file diff --git a/common/src/config/static-config.ts b/common/src/config/static-config.ts index e7d850f92..5b2e7d0d8 100644 --- a/common/src/config/static-config.ts +++ b/common/src/config/static-config.ts @@ -94,14 +94,4 @@ export const OMNI_CONFIG: ServerConfig = { name: "Omnitachi", supportedGames: allSupportedGames, supportedImportTypes: allImportTypes, -}; - -export function FormatGame(game: Game, playtype: Playtypes[Game]): string { - const gameConfig = GetGameConfig(game); - - if (gameConfig.validPlaytypes.length === 1) { - return gameConfig.name; - } - - return `${gameConfig.name} (${playtype})`; -} +}; \ No newline at end of file diff --git a/common/src/utils/util.ts b/common/src/utils/util.ts index c17acce8b..b28eb92fd 100644 --- a/common/src/utils/util.ts +++ b/common/src/utils/util.ts @@ -1,4 +1,4 @@ -import { AnyChartDocument, Game } from ".."; +import { AnyChartDocument, Game, Playtypes } from ".."; import { GetGameConfig } from "../config/config"; export function FormatDifficulty(chart: AnyChartDocument, game: Game): string { @@ -9,3 +9,13 @@ export function FormatDifficulty(chart: AnyChartDocument, game: Game): string { return `${chart.difficulty}`; } + +export function FormatGame(game: Game, playtype: Playtypes[Game]): string { + const gameConfig = GetGameConfig(game); + + if (gameConfig.validPlaytypes.length === 1) { + return gameConfig.name; + } + + return `${gameConfig.name} (${playtype})`; +}