Closed jpickwell closed 6 years ago
Did you pass --extended
flag.
It works with metadata.full.json
.
Your metadata is not complete.
Oh, isValidNumber
, maybe I'll test that one instead
Still valid.
Let me try rebuilding my metadata.
Sorry about that. I completely forgot about updating the metadata after updating to a newer version of this library. I was already using the --extended
flag, but was using outdated metadata. Thanks for the quick response.
Ouch, you got me.
The recent refactor added possibleLengths
property and I didn't think about backwards-compatibility.
It's true that some users generated metadata with the old version and don't re-generate metadata upon publishing the project.
Maybe I should add some backwards compatibility.
(added backwards compatibility)
Passing a number like
18772155230
intoisValidNumberCustom('18772155230', 'US', <US-only metadata>)
, the function returnsfalse
even though Google's library will indicate that it's valid.https://rawgit.com/googlei18n/libphonenumber/master/javascript/i18n/phonenumbers/demo-compiled.html