Skip to the content

Taisen Brackets対戦

Knockout brackets as SVG, from a list of ties.

Taisen (対戦, たいせん) is Japanese for a matchup: two sides facing each other. About the name

Contents

Reference · Draw a bracket, a table or a road to the final

judoSecondsfunction

A time as seconds: a number, or "m:ss".

Import it

import { judoSeconds } from "@johnmorrisdotca/taisen-brackets";

Definition

function judoSeconds(time: number | string | undefined): number | null

Parameters

NameTypeDescription
timestring | number | undefined

A number of seconds, or text such as 4:00 or 1:12.

Returns

number | null

The seconds; null when there is no time. Text that is not a time throws a RangeError.

Examples

import { judoSeconds } from "@johnmorrisdotca/taisen-brackets";

console.log(judoSeconds("4:00"), judoSeconds(72), judoSeconds(undefined));
240 72 null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/taisen-brackets 0.20.0.