Reference · Draw a bracket, a table or a road to the final
MedalFiltertype
What tallyMedals keeps: awards equal to every field given. A value can be a list (any of them).
Import it
import type { MedalFilter } from "@johnmorrisdotca/taisen-brackets";
Definition
interface MedalFilter {
sport?: string | readonly string[];
category?: string | readonly string[];
games?: string | number | readonly (string | number)[];
}
Members
| Name | Type | Description |
|---|---|---|
sport (optional) | string | readonly string[] | undefined | |
category (optional) | string | readonly string[] | undefined | |
games (optional) | string | number | readonly (string | number)[] | undefined |
Examples
import { tallyMedals, type MedalFilter } from "@johnmorrisdotca/taisen-brackets";
const filter: MedalFilter = { sport: "judo", games: [2020, 2024] };
console.log(tallyMedals([{ name: "France", medal: "gold", sport: "judo", games: 2024 }, { name: "Japan", medal: "gold", sport: "wrestling", games: 2024 }], filter).length);1What it prints (run when this page was built)