本文へ移動

Hata旗

国や地域の旗を読み込み、対応する表示の形を選び、絵ごとの資料・作者・ライセンスを保てます。

「旗(はた)」は、旗を表す日本語です。 名前について(英語)

目次

リファレンス · 旗の資料と表示の情報

flagOn関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The flag of a day with the reason for a blank: variantOn, and where it has nothing to draw (no flag known that day, or a restricted one withheld), none says why in words and in a kind.

インポート

import { flagOn } from "@johnmorrisdotca/hata/manifest";

定義

function flagOn(code: string, date: string | Date, options?: VariantOptions): FlagOnDay

引数

名前型説明
codestring

A code in any case.

datestring | Date

The day: a Date, or "YYYY-MM-DD", "YYYY-MM" or "YYYY".

options (省略可)VariantOptions | undefined

role and allowRestricted, as for variantOn.

戻り値

FlagOnDay

A FlagOnDay, always: variant is null and none is set where the package has no flag for it.

例

import { flagOn } from "@johnmorrisdotca/hata/manifest";

console.log(flagOn("DE", "1940").none?.reason);  // "Flag of Nazi Germany, 1935–1945. Shown for history and education. …"
console.log(flagOn("SUHH", "1992-01-01").none?.kind); // "ended"
console.log(flagOn("CA", "1962-09-29", { role: "in-use" }).variant?.id); // "red-ensign-1957"
Flag of Nazi Germany, 1935–1945. Shown for history and education. Displaying it is restricted by law in Germany and Austria outside those purposes.
ended
red-ensign-1957

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hata 1.31.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。