Skip to content

Cannot give getCountryCallingCode a parameter only accept strings #483

@AxelPotato

Description

@AxelPotato

When using the following code to get the phone code of a country I get an unexpected error.

const countryString = getKeyByValue(isoCountries, jsonData['user']["country"]) // returns 'IL'
let phoneCode = getCountryCallingCode(countryString) // gives error...

Error the compiler gives:
Argument of type 'string' is not assignable to parameter of type 'CountryCode'

If I give it a string like this:

let phoneCode = getCountryCallingCode('IL') // returns 972 as expected

I am writing this inside activepieces code interpreter so I am unsure what version of Node it is running there...

Any clue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions