Reference · Draw a bracket, a table or a road to the final
describeMedalTablefunction
The table as a sentence, the drawing's description.
Import it
import { describeMedalTable } from "@johnmorrisdotca/taisen-brackets";
Definition
function describeMedalTable(source: MedalTableSource, options?: Pick<MedalTableOptions, "locale" | "words" | "sort" | "ties" | "top" | "skipEmpty">): string
Parameters
| Name | Type | Description |
|---|---|---|
source | MedalTableSource | The medal table. |
options (optional) | Pick<MedalTableOptions, "locale" | "words" | "ties" | "sort" | "top" | "skipEmpty"> | The language, the words, the sort and the rows chosen. |
Returns
string
The description.
Examples
import { describeMedalTable } from "@johnmorrisdotca/taisen-brackets";
console.log(describeMedalTable({ rows: [
{ name: "France", flag: "FR", gold: 6, silver: 1, bronze: 3 },
{ name: "Japan", flag: "JP", gold: 5, silver: 3, bronze: 2 },
] }));Medal table. 1, France, 6 gold, 1 silver, 3 bronze, 10 total. 2, Japan, 5 gold, 3 silver, 2 bronze, 10 total.What it prints (run when this page was built)