Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -12,10 +12,12 @@ export function leaderboardReturnHref(value: string | null | undefined): string
|
||||
const params = new URLSearchParams();
|
||||
for (const key of contextKeys) {
|
||||
const entry = url.searchParams.get(key);
|
||||
if (entry || key === 'map' && entry !== null) params.set(key, entry!);
|
||||
if (entry || (key === 'map' && entry !== null)) params.set(key, entry!);
|
||||
}
|
||||
return `/leaderboard${params.size ? `?${params}` : ''}`;
|
||||
} catch { return '/leaderboard'; }
|
||||
} catch {
|
||||
return '/leaderboard';
|
||||
}
|
||||
}
|
||||
|
||||
export function playerContextHref(guid: string, source: string): string {
|
||||
@@ -31,7 +33,8 @@ export function playerContextHref(guid: string, source: string): string {
|
||||
if (game === 't5' || game === 't6') params.set('game', game);
|
||||
if (map !== null && map.length <= 1024) params.set('map', map);
|
||||
if (players && /^[1-4]$/.test(players)) params.set('players', players);
|
||||
if (metric && leaderboardMetrics.some(item => item.key === metric)) params.set('metric', metric);
|
||||
if (metric && leaderboardMetrics.some((item) => item.key === metric))
|
||||
params.set('metric', metric);
|
||||
return `/leaderboard/players/${encodeURIComponent(guid)}?${params}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user