Skip to content

Data update: Typing for 3 Letter country code #174

Description

@avalatea

Data changes

Right now, the typing for 3 letter codes are awkward:

import countries3to2 from 'countries-list/minimal/countries.3to2.min.json';

function convert(threeCode: keyof typeof countries3to2): string {
    return countries3to2[threeCode];
}

If we can get one of the below, the typing would be a lot less awkward:

  • an internal, typed function that does countries3to2 conversion
  • a typed list of 3 codes

Links & sources

Here is a valid source for this change:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions