Reference · Draw a bracket, a table or a road to the final
rankingCategoryLabelfunction
A category as a heading ("U18 · Men -60 kg"): an age group, a sex and a weight, any of them, joined by a dot. A weight is -60 or +100 (kg) or any text.
Import it
import { rankingCategoryLabel } from "@johnmorrisdotca/taisen-brackets";
Definition
function rankingCategoryLabel(category: { age?: string; sex?: "men" | "women" | "open"; weight?: string; }, locale?: string): string
Parameters
| Name | Type | Description |
|---|---|---|
category | { age?: string; sex?: "men" | "women" | "open"; weight?: string; } | The age group, the sex and the weight class, each optional. |
locale (optional) | string | undefined | The language. Default English. |
Returns
string
The label.
Examples
import { rankingCategoryLabel } from "@johnmorrisdotca/taisen-brackets";
console.log(rankingCategoryLabel({ age: "U18", sex: "men", weight: "-60" }));U18 · Men -60 kgWhat it prints (run when this page was built)