src/components/PhoneNumber/components/Input.js
function should_add_international_option(properties)
{
	const { countries, international } = properties

	// If this behaviour is explicitly set, then do as it says.
	if (international !== undefined)
	{
		return international
	}

	// If `countries` is empty,
	// then only "International" option is available, so add it.
	if (countries.length === 0)
	{
		return true
	}

	// If `countries` is a single allowed country,
	// then don't add the "International" option
	// because it would make no sense.
	if (countries.length === 1)
	{
		return false
	}

	// Show the "International" option by default
	return true
}
function should_add_international_option(properties)
{
	const { countries, international } = properties

	// If this behaviour is explicitly set, then do as it says.
	if (international !== undefined)
	{
		return international
	}

	// If `countries` is empty,
	// then only "International" option is available, so add it.
	if (countries.length === 0)
	{
		return true
	}

	// If `countries` is a single allowed country,
	// then don't add the "International" option
	// because it would make no sense.
	if (countries.length === 1)
	{
		return false
	}

	// Show the "International" option by default
	return true
}
function should_add_international_option ( properties ) { const { countries , international } = properties // If this behaviour is explicitly set, then do as it says. if ( international !== undefined ) { return international } // If `countries` is empty, // then only "International" option is available, so add it. if ( countries . length === 0 ) { return true } // If `countries` is a single allowed country, // then don't add the "International" option // because it would make no sense. if ( countries . length === 1 ) { return false } // Show the "International" option by default return true }
Whether to add the "International" option to the list of countries
Whether to add the International option to the list of countries