Skip to content

fetchIsoCodesStateDefinitions

fetchIsoCodesStateDefinitions(options): Promise<IsoCodesStateDefinitions>

Defined in: packages/simply-settings-core/src/address/isoCodes/index.ts:77

Downloads ISO 3166-2 data from a source and converts it to state definitions. Nothing is cached or written to disk.

FetchIsoCodesStateDefinitionsOptions

The source, an optional version, allLevels, and HTTP settings.

Promise<IsoCodesStateDefinitions>

The definitions, with the source, version, and URL they came from.

SfError (UnsupportedIsoCodesSourceError) for an unknown source; otherwise whatever the source’s adapter throws, or (InvalidIsoCodesDataError) when its data fails validation.