Reference · Where every tie sits
collectTeamsfunction
A bracket's teams: the list given, plus a team made from every id that a matchup names and the list does not.
Import it
import { collectTeams } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
function collectTeams(matchups: readonly Matchup[], given?: readonly Team[]): Map<SideId, Team>
Parameters
| Name | Type | Description |
|---|---|---|
matchups | readonly Matchup[] | The matchups whose sides are to be found. |
given (optional) | readonly Team[] | The teams listed once, with names, marks and groups. |
Returns
Map<SideId, Team>
A map from each side's id to its team.
Examples
import { collectTeams } from "@johnmorrisdotca/taisen-brackets";
const teams = collectTeams([{ sides: ["ARG", "FRA"], score: [3, 3] }], [{ id: "ARG", name: "Argentina" }]);
console.log(teams.get("ARG")?.name, teams.get("FRA")?.name);Argentina FRAWhat it prints (run when this page was built)