Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions worker/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -191,17 +191,21 @@
const chains = (dims.chain ?? []).map((d) => d.value).filter((v) => v !== "all");
const regions = (dims.region ?? []).map((d) => d.value).filter((v) => v !== "all");
const kinds = (dims.kind ?? []).map((d) => d.value).filter((v) => v !== "all");
const venues = (dims.venue ?? []).map((d) => d.value).filter((v) => v !== "all");

Check failure on line 194 in worker/index.ts

View workflow job for this annotation

GitHub Actions/ check

Parameter 'v' implicitly has an 'any' type.

Check failure on line 194 in worker/index.ts

View workflow job for this annotation

GitHub Actions/ check

Parameter 'd' implicitly has an 'any' type.

Check failure on line 194 in worker/index.ts

View workflow job for this annotation

GitHub Actions/ check

Property 'venue' does not exist on type '{ chain?: { value: string; label: string; }[] | undefined; region?: { value: string; label: string; }[] | undefined; kind?: { value: string; label: string; }[] | undefined; }'.
const opt = <T,>(xs: T[]): (T | undefined)[] => (xs.length ? [undefined, ...xs] : [undefined]);
const combos: BenchmarkFilters[] = [];
for (const chain of opt(chains)) {
for (const region of opt(regions)) {
for (const kind of opt(kinds)) {
if (!chain && !region && !kind) continue; // the aggregate is tier A
combos.push({
...(chain ? { chain } : {}),
...(region ? { region } : {}),
...(kind ? { kind } : {}),
});
for (const venue of opt(venues)) {
if (!chain && !region && !kind && !venue) continue; // the aggregate is tier A
combos.push({
...(chain ? { chain } : {}),
...(region ? { region } : {}),
...(kind ? { kind } : {}),
...(venue ? { venue } : {}),
});
}
}
}
}
Expand DownExpand Up@@ -297,6 +301,7 @@
if (f.chain) qs.set("chain", f.chain);
if (f.region) qs.set("region", f.region);
if (f.kind) qs.set("kind", f.kind);
if (f.venue) qs.set("venue", f.venue);

Check failure on line 304 in worker/index.ts

View workflow job for this annotation

GitHub Actions/ check

Property 'venue' does not exist on type 'BenchmarkFilters'.

Check failure on line 304 in worker/index.ts

View workflow job for this annotation

GitHub Actions/ check

Property 'venue' does not exist on type 'BenchmarkFilters'.
return `/api/bench/${slug}/variant${qs.size ? `?${qs.toString()}` : ""}`;
}

Expand Down
Loading