src/components/PhoneNumber/components/Input.js
function parse_partial_number(value, country_code, metadata)
{
	// "As you type" formatter
	const formatter = new as_you_type(country_code, metadata)

	// Input partially entered phone number
	formatter.input('+' + getPhoneCode(country_code) + value)

	// Return the parsed partial phone number
	// (has `.national_number`, `.country`, etc)
	return formatter
}
function parse_partial_number(value, country_code, metadata)
{
	// "As you type" formatter
	const formatter = new as_you_type(country_code, metadata)

	// Input partially entered phone number
	formatter.input('+' + getPhoneCode(country_code) + value)

	// Return the parsed partial phone number
	// (has `.national_number`, `.country`, etc)
	return formatter
}
function parse_partial_number ( value , country_code , metadata ) { // "As you type" formatter const formatter = new as_you_type ( country_code , metadata ) // Input partially entered phone number formatter . input ( '+' + getPhoneCode ( country_code ) + value ) // Return the parsed partial phone number // (has `.national_number`, `.country`, etc) return formatter }
Parses a partially entered phone number and returns the national number so far. Not using `libphonenumber-js`'s `parse` function here because `parse` only works when the number is fully entered, and this one is for partially entered number.
Parses a partially entered phone number and returns the national number so far . Not using libphonenumber - js s parse function here because parse only works when the number is fully entered and this one is for partially entered number .