tagsOf関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { tagsOf } from "@johnmorrisdotca/hata/search";
定義
function tagsOf(code: string, options?: { variant?: string; }): readonly FlagTag[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
code | string | A flag's code in any case: "JP", "jp-13", "CA_ON"; a former country by its code or one of its aliases. |
options (省略可) | { variant?: string; } | undefined |
|
戻り値
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.
例
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' }
]
[]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。