src/components/PhoneNumber/components/Input.js
function normalize_country_code(country, dictionary)
{
	// Normalize `country` if it's an empty string
	if (country === '')
	{
		country = undefined
	}

	// No country is selected ("International")
	if (country === undefined || country === null)
	{
		return country
	}

	// Check that `country` code exists
	if (dictionary[country] || default_dictionary[country])
	{
		return country
	}

	throw new Error(`Unknown country: "${country}"`)
}
function normalize_country_code(country, dictionary)
{
	// Normalize `country` if it's an empty string
	if (country === '')
	{
		country = undefined
	}

	// No country is selected ("International")
	if (country === undefined || country === null)
	{
		return country
	}

	// Check that `country` code exists
	if (dictionary[country] || default_dictionary[country])
	{
		return country
	}

	throw new Error(`Unknown country: "${country}"`)
}
function normalize_country_code ( country , dictionary ) { // Normalize `country` if it's an empty string if ( country === '' ) { country = undefined } // No country is selected ("International") if ( country === undefined || country === null ) { return country } // Check that `country` code exists if ( dictionary [ country ] || default_dictionary [ country ] ) { return country } throw new Error ( ` ${ country } ` ) }
Validates country code
Validates country code