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

safeUrlfunction

Whether an image address is one a drawing will load: http(s), a relative path, or a data:image/.

Import it

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

Definition

function safeUrl(url: string): boolean

Parameters

NameTypeDescription
urlstring

The address.

Returns

boolean

true when the address is allowed.

Examples

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

console.log(safeUrl("https://example.com/mark.svg"), safeUrl("javascript:alert(1)"));
true false

What it prints (run when this page was built)

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