Closed alexeyr-ci closed 1 year ago
@alexeyr-ci changed behaviour in v0.8.4 to provide formatted result when number is possible instead of valid
@daddyz a version change from 0.8.3
to 0.9.0
might have been better here, well actually from 0.9.x
to 0.10.0
because of the other breaking change earlier
https://github.com/daddyz/phonelib/issues/297#issue-2135368672
E.g.
+15555555555
is possible but not valid. So I getStill it's clear it should be formatted as
(555) 555-55-55
nationally, and+1 555-555-55-55
internationally, and indeed if I doPhonelib.add_additional_regex :us, Phonelib::Core::MOBILE, '555\d{7}'
, Phonelib knows how to format it.Indeed, https://libphonenumber.appspot.com/phonenumberparser?number=%2B15555555555 gives
but from its code I think
invalid
is due to an explicit check and "Original format" is the international format in this case.Is it possible to change the formatting methods to work in this way or at least to add an option?