Reference · Draw a bracket, a table or a road to the final
judoOutcomefunction
Checks a result against the rules and works out who won and how. winner is the winner the matchup names (needed for fusen-gachi and
kiken-gachi, which no score can show). Throws a RangeError for a count out of range, two ippon, a method the scores contradict, or a
default with no winner.
Import it
import { judoOutcome } from "@johnmorrisdotca/taisen-brackets";
Definition
function judoOutcome(result: JudoResult, winner?: 0 | 1 | null): JudoOutcome
Parameters
| Name | Type | Description |
|---|---|---|
result | JudoResult | The scores and, optionally, the method, the golden score and the time. |
winner (optional) | 0 | 1 | null | Who won, when the scores do not say (a decision by the referees, a withdrawal): 0 or 1. |
Returns
JudoOutcome
The outcome: the winner (null when there is none yet), the method, the points, the time and whether golden score was played.
Examples
import { judoOutcome } from "@johnmorrisdotca/taisen-brackets";
const o = judoOutcome({ sides: [{ yuko: 2 }, { wazaAri: 1, shido: 1 }], time: "4:00" });
console.log(o.winner, o.method, o.points.join(" "));1 score 2 10What it prints (run when this page was built)