リファレンス
国と検索の道具
import { … } from "@johnmorrisdotca/kuni";
最小化と gzip 圧縮をしたサイズは 21.4 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
Continent | 型 | A continent's two letters: "AF", "AN", "AS", "EU", "NA", "OC" or "SA". |
continentName | 関数 | A continent's name, from CLDR. |
CONTINENTS | 定数 | The seven continents, as two letters: Africa, Antarctica, Asia, Europe, North America, Oceania, South America. |
countries | 関数 | Every country: the 249 ISO 3166-1 codes and Kosovo (XK). |
CountriesOptions | 型 | What countries() may be asked. |
country | 関数 | One country by its code. |
Country | 型 | A country, or a territory with an ISO 3166-1 code of its own, as the lookups hand it out (frozen). |
COUNTRY_CODES | 定数 | The 250 country codes: the 249 ISO 3166-1 alpha-2 codes and XK for Kosovo, in alphabetical order. |
countryByName | 関数 | A country from what somebody typed: its name or short name in English or Japanese ("Germany", ドイツ, どいつ), its own name ("Deutschland"), a name it is also known by ("Holland", "UK", 米国), or a code. |
CountryCode | 型 | One of the 250 country codes, as a type: "JP" | "US" | ... |
countryName | 関数 | A country's name in English or Japanese. |
CountryNameOptions | 型 | What countryName() may be asked. |
CountryOrder | 型 | The order countries() lists them in: "code" (alpha-2), "en" (by English name) or "ja" (by Japanese name, in kana). |
flag | 関数 | The flag of a country as an emoji: two regional-indicator letters, which most systems draw as the flag and some (Windows) as the two letters. |
fold | 関数 | What two ways of typing a name have in common: width (full-width letters to ASCII, half-width katakana to full), case, accents (except the two marks that make が and ぱ), katakana to hiragana, apostrophes dropped, and every other run of punctuation or space to one space. |
isCountryCode | 関数 | Whether a value is one of the 250 codes exactly as ISO writes it: two capital letters ("JP", and "XK" for Kosovo). |
Language | 型 | A language every name is kept in: "en" or "ja". |
LANGUAGES | 定数 | The two languages every name is kept in. |
Subdivision | 型 | A subdivision of a country (a state, a province, a prefecture), with its ISO 3166-2 code, as the lookups hand it out (frozen). |
SubdivisionType | 型 | A kind of subdivision, in kebab case: "prefecture", "state", "autonomous-community". |
subregionName | 関数 | A UN M49 subregion's name, from CLDR. |
VERSION | 定数 | The package's version, the same as package.json's. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。