collectTeams関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A bracket's teams: the list given, plus a team made from every id that a matchup names and the list does not.
インポート
import { collectTeams } from "@johnmorrisdotca/taisen-brackets/layout";
ほかのエクスポート元: @johnmorrisdotca/taisen-brackets
定義
function collectTeams(matchups: readonly Matchup[], given?: readonly Team[]): Map<SideId, Team>
引数
| 名前 | 型 | 説明 |
|---|---|---|
matchups | readonly Matchup[] | The matchups whose sides are to be found. |
given (省略可) | readonly Team[] | The teams listed once, with names, marks and groups. |
戻り値
Map<SideId, Team>
A map from each side's id to its team.
例
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 FRA出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。