1.0.2 • Published 2 years ago

@ottatech/locations v1.0.2

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

@ottatech/locations

Location information shared across otta apps.

Provides:

  • regions: a map of ISO-3166 alpha-2 codes and their English language names
  • subregions: a map of ISO-3166 alpha-2 code to a map of CLDR subregions and their English language names.

Reference:

Usage

import { regions, subregions } from "@ottatech/locations";

const user = { region: 'US', subregion: 'USTX' };

const countryLabel = regions[user.region]; // United States
const subregionLabel = subregions[user.region][user.subregion]; // Texas