ts-phonenumber - v2.0.0
    Preparing search index...

    Function getMainCountryForCode

    • Gets the main country for a country calling code. For country codes shared by multiple regions (e.g., +1 for US/CA), returns the primary region.

      Parameters

      • countryCode: number

        The country calling code

      Returns Promise<string | undefined>

      The main region code or undefined if unknown

      await getMainCountryForCode(1)   // "US"
      await getMainCountryForCode(44) // "GB"
      await getMainCountryForCode(49) // "DE"