medalRanks関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The ranks of a list of rows, as medalTable draws them ([1, 2, 2, 4]), in the order they are drawn.
インポート
import { medalRanks } from "@johnmorrisdotca/taisen-brackets";
定義
function medalRanks(rows: readonly MedalRow[], options?: Pick<MedalTableOptions, "sort" | "ties">): number[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
rows | readonly MedalRow[] | The rows, in the order they are listed. |
options (省略可) | Pick<MedalTableOptions, "ties" | "sort"> |
|
戻り値
number[]
The ranks, one for each row.
例
import { medalRanks } from "@johnmorrisdotca/taisen-brackets";
const rows = [{ name: "A", gold: 1 }, { name: "B", gold: 1 }, { name: "C", silver: 3 }, { name: "D", silver: 1 }];
console.log(medalRanks(rows).join(" "), medalRanks(rows, { sort: "total" }).join(" "));1 1 3 4 1 2 2 4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。