Closed TaWReOn closed 4 years ago
I'm wondering why undefined value is returned in a code below:
That's because having only one digit is not a valid phone number. The minimum is 3 digits. This is how it's implemented in google's code. See Google's demo.
Steps to reproduce
I'm wondering why undefined value is returned in a code below:
const { parsePhoneNumberFromString } = phoneNumberJs.current;
parsePhoneNumberFromString('+393'); // returns undefined
parsePhoneNumberFromString('+3501') // returns undefined
parsePhoneNumberFromString('+71') // returns undefined
What's the observed result?
undefined value is returned
What's the expected result?
expecting an object with a parsed phone number to be returned