Reference
All subdivisions
import { … } from "@johnmorrisdotca/kuni/subdivisions";
88.4 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
allSubdivisions | function | Every subdivision of every country, every level, in code order. |
Level | type | A level of subdivision: 1 for a country's first division, 2 and 3 for those inside one, or "all". |
subdivision | function | One subdivision by its ISO 3166-2 code. |
Subdivision | type | A subdivision of a country (a state, a province, a prefecture), with its ISO 3166-2 code, as the lookups hand it out (frozen). |
SUBDIVISION_TYPES | constant | The kinds of subdivision, in kebab case. |
subdivisionByName | function | The one subdivision a typed name means. |
SubdivisionByNameOptions | type | What subdivisionByName() and subdivisionsByName() may be narrowed to. |
subdivisionByShortCode | function | One subdivision by its country and the part of its code after the hyphen. |
subdivisions | function | A country's subdivisions, in code order: the first level unless level asks for another or for "all". |
subdivisionsByName | function | Every subdivision a typed name could be, in code order: its English or Japanese name, its Japanese name without the word for its kind (オンタリオ, 東京), a prefecture's reading, or its full code. |
SubdivisionsOptions | type | What subdivisions() may be asked. |
SubdivisionType | type | A kind of subdivision, in kebab case: "prefecture", "state", "autonomous-community". |
subdivisionTypeLabel | function | The word for a kind of subdivision. |