Reference · Places outside ISO 3166-1
reservedPlacefunction
One place outside ISO 3166-1, by its code ("IC", "ic"), its three letters ("ASC") or its id ("somaliland").
Import it
import { reservedPlace } from "@johnmorrisdotca/kuni/reserved";
Definition
function reservedPlace(text: string): ReservedPlace | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | A code, in either case, or an id. |
Returns
ReservedPlace | null
The place, frozen; null for anything else, a country's code included.
Examples
import { reservedPlace } from "@johnmorrisdotca/kuni/reserved";
console.log(reservedPlace("IC")?.name.ja); // "カナリア諸島"
console.log(reservedPlace("ea")?.subdivisions); // ["ES-CE", "ES-ML"]
console.log(reservedPlace("AC")?.parent); // "GB"
console.log(reservedPlace("somaliland")?.kind); // "de-facto"
console.log(reservedPlace("JP")); // nullカナリア諸島
[ 'ES-CE', 'ES-ML' ]
GB
de-facto
nullWhat it prints (run when this page was built)