ChemPal Documentation - v1.6.0
    Preparing search index...

    Module helpers/country

    Functions - Country Helpers

    findCountryByIso2

    Looks up a country record by its two-letter ISO 3166-1 alpha-2 code. Wraps the untyped country-list-js findByIso2 in a type guard so callers get a typed result instead of any.

    getCountryName

    Resolves the full country name for a two-letter location code.

    findCountryByName

    Resolves a country's ISO 3166-1 alpha-2 code from its full English name. Wraps the untyped country-list-js findByName (whose record nests the code as { code: { iso2 } }), title-casing the input first since the library matches only Title Case. Returns undefined for unknown names (including short aliases like "USA" that the library doesn't index — callers handle those separately).

    getUserCountryName

    Reads the user's selected country (full name) from persisted user settings. The country field is kept in sync with the location code by the settings reducer, so consumers that need a full country name can read it directly.

    Modules

    <internal>