Reference
Country code validation
import { … } from "@johnmorrisdotca/kuni/codes";
0.6 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
COUNTRY_CODES | constant | The 250 country codes: the 249 ISO 3166-1 alpha-2 codes and XK for Kosovo, in alphabetical order. |
CountryCode | type | One of the 250 country codes, as a type: "JP" | "US" | ... |
isCountryCode | function | Whether a value is one of the 250 codes exactly as ISO writes it: two capital letters ("JP", and "XK" for Kosovo). |