本文へ移動

Hata旗

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

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

目次

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

FlagSource型

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

Where a drawing comes from: Wikimedia Commons (the file Wikidata names as the place's flag), or one of the MIT flag sets, chosen where it draws the same flag at its true proportions and is smaller, or is free where Commons' file is not.

インポート

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

定義

type FlagSource = "commons" | "flag-icons" | "country-flag-icons";

例

import { MANIFEST, type FlagSource } from "@johnmorrisdotca/hata/manifest";

const fromSets: FlagSource[] = ["flag-icons", "country-flag-icons"];
console.log(MANIFEST.filter((one) => fromSets.includes(one.source)).map((one) => one.code)); // ["YE"]
[ 'YE' ]

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

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

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