My country code utility showing strange data parsing issues?

Author
Ayo Ndiaye Author
|
2 hours ago Asked
|
4 Views
|
0 Replies
0

Hey everyone, I'm running into a weird data parsing issue with our 'Country Codes Directory' tool. Specifically, our country code utility is giving inconsistent output for certain international dialing codes, which is pretty frustrating.

I've attached a snippet of what I'm seeing:

console.log(getCountryCode('Germany'));
// Expected: +49
// Actual:   +49 (DEU)

console.log(getCountryCode('France'));
// Expected: +33
// Actual:   +33 (FRA)

console.log(getCountryCode('United Kingdom'));
// Expected: +44
// Actual:   +44 (GBR) - Note: Sometimes +44 (UK)

console.log(getCountryCode('Canada'));
// Expected: +1
// Actual:   +1 (CA) - Note: Sometimes +1

console.log(getCountryCode('Australia'));
// Expected: +61
// Actual:   +61 (AUS) - Note: Sometimes +61 (AU)

Has anyone experienced similar issues or have insights into debugging this? Help a brother out please...

0 Answers

No answers yet.

Be the first to provide a helpful answer!

Your Answer

You must Log In to post an answer and earn reputation.