Reference · Where every tie sits
roundLabelfunction
The name of round round (1 is the first) of a layout, from the names given (which may be only the last rounds) or the generic ones.
Import it
import { roundLabel } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
function roundLabel(layout: BracketLayout, round: number, names: DrawOptions["roundNames"], v: Voice): string
Parameters
| Name | Type | Description |
|---|---|---|
layout | BracketLayout | The bracket's layout. |
round | number | The round, counting from 1 at the first round. |
names | readonly string[] | { rounds: readonly { name: string; }[]; } | undefined | The |
v | Voice | The voice of a language, from |
Returns
string
The label to write.
Examples
import { layoutBracket, roundLabel, voiceOf } from "@johnmorrisdotca/taisen-brackets";
const layout = layoutBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }, { sides: ["Cascade", "Delta"], score: [0, 1] }, { sides: ["Aurora", "Delta"], score: [3, 1] }]);
console.log(roundLabel(layout, 1, undefined, voiceOf({ locale: "fr" })));Demi-finalesWhat it prints (run when this page was built)