Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · Flag source and framing metadata

VariantOptionstype

What variantsOf, variantOn and flagOn take: allowRestricted, to include the flags the law restricts (RESTRICTED); role, which flag of the day to give.

Import it

import type { VariantOptions } from "@johnmorrisdotca/hata/manifest";

Definition

interface VariantOptions {
    role?: FlagRole;
    allowRestricted?: boolean;
}

Members

NameTypeDescription
role (optional)FlagRole | undefined

Which flag of the day: the legal one (the default) or the one in-use in practice. Where they are the same flag, the answer is the same.

allowRestricted (optional)boolean | undefined

Include a flag whose display the law restricts. Left out, it is never given: variantsOf leaves it out of the list, and variantOn says the day has one and gives its restriction and reason in place of a drawing (withheld).

Examples

import { variantOn, type VariantOptions } from "@johnmorrisdotca/hata/manifest";

const asked: VariantOptions = { role: "in-use" };
console.log(variantOn("CA", "1962-09-29", asked)?.id); // "red-ensign-1957"
red-ensign-1957

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.