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
引数
| 名前 | 型 | 説明 |
|---|---|---|
code | string | A code in any case. |
date | string | Date | The day: a |
options (省略可) | VariantOptions | undefined |
|
戻り値
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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。