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 · Flags by their colours

tagsOffunction

What is on a flag, as tags from the closed list, each with where it comes from. A tag that is unreviewed is a guess: show it as one, or leave it out. A flag with no tag yet has an empty list, which does not say it is plain. manifest(code).tags has the same tags with what each rests on.

Import it

import { tagsOf } from "@johnmorrisdotca/hata/search";

Definition

function tagsOf(code: string, options?: { variant?: string; }): readonly FlagTag[]

Parameters

NameTypeDescription
codestring

A flag's code in any case: "JP", "jp-13", "CA_ON"; a former country by its code or one of its aliases.

options (optional){ variant?: string; } | undefined

variant: the id of another of the place's flags (variantsOf(code)), such as Afghanistan's "de-facto".

Returns

readonly FlagTag[]

The tags, frozen, in the order of FLAG_TAGS; an empty list when the code has no flag here, no such variant, or no tag yet.

Examples

import { tagsOf } from "@johnmorrisdotca/hata/search";

console.log(tagsOf("DE")); // [{ tag: "plain", source: "computed" }, { tag: "stripes-horizontal", source: "computed" }]
console.log(tagsOf("DK")); // [{ tag: "cross", source: "wikidata" }, { tag: "nordic-cross", source: "wikidata" }]
console.log(tagsOf("XX")); // []
[
  { tag: 'plain', source: 'computed' },
  { tag: 'stripes-horizontal', source: 'computed' }
]
[
  { tag: 'cross', source: 'wikidata' },
  { tag: 'nordic-cross', source: 'wikidata' }
]
[]

What it prints (run when this page was built)

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