style(api): apply prettier formatting

This commit is contained in:
dahyeon committed 2026-07-24 21:42:28 -07:00
1 parent 80fef25af3
commit 96fede9fe5
75 files changed
+955 -674

No files matched your search

@@ -114,7 +114,9 @@ export class RiotDdragonService {
constructor(private readonly redisService: RedisService) {}
public async getManifest(locale: string = DEFAULT_LOCALE): Promise<DdragonManifest> {
public async getManifest(
locale: string = DEFAULT_LOCALE,
): Promise<DdragonManifest> {
const normalizedLocale = normalizeLocale(locale);
const cacheKey = manifestCacheKey(normalizedLocale);
@@ -139,12 +141,14 @@ export class RiotDdragonService {
private async buildManifest(locale: string): Promise<DdragonManifest> {
const version = await this.fetchLatestVersion();
const [champions, summonerSpells, runesReforged, items] = await Promise.all([
this.fetchChampionMap(version, locale),
this.fetchSummonerSpellMap(version, locale),
this.fetchRuneStyles(version, locale),
this.fetchItemMap(version, locale),
]);
const [champions, summonerSpells, runesReforged, items] = await Promise.all(
[
this.fetchChampionMap(version, locale),
this.fetchSummonerSpellMap(version, locale),
this.fetchRuneStyles(version, locale),
this.fetchItemMap(version, locale),
],
);
return {
version,
cdn: DDRAGON_CDN,
@@ -158,7 +162,9 @@ export class RiotDdragonService {
}
private async fetchLatestVersion(): Promise<string> {
const versions = await this.fetchJson<unknown>(`${DDRAGON_BASE}/api/versions.json`);
const versions = await this.fetchJson<unknown>(
`${DDRAGON_BASE}/api/versions.json`,
);
if (!Array.isArray(versions) || typeof versions[0] !== 'string') {
throw new Error('ddragon versions.json response is malformed.');
}
@@ -219,7 +225,9 @@ export class RiotDdragonService {
const url = `${DDRAGON_CDN}/${version}/data/${locale}/runesReforged.json`;
const payload = await this.fetchJson<unknown>(url);
if (!Array.isArray(payload)) {
throw new Error(`ddragon runesReforged.json response is malformed (${url}).`);
throw new Error(
`ddragon runesReforged.json response is malformed (${url}).`,
);
}
return payload
@@ -229,8 +237,7 @@ export class RiotDdragonService {
key: style.key,
icon: style.icon,
name: style.name,
shortDesc:
typeof style.shortDesc === 'string' ? style.shortDesc : '',
shortDesc: typeof style.shortDesc === 'string' ? style.shortDesc : '',
longDesc: typeof style.longDesc === 'string' ? style.longDesc : '',
slots: (style.slots ?? []).map((slot) => ({
runes: (slot.runes ?? [])
@@ -290,9 +297,7 @@ export class RiotDdragonService {
signal: controller.signal,
});
if (!response.ok) {
throw new Error(
`ddragon request failed (${response.status}): ${url}`,
);
throw new Error(`ddragon request failed (${response.status}): ${url}`);
}
return (await response.json()) as T;
} catch (err) {