Announcing elm-phone-numbers: validate those things!

Here is the first release of Skinney/elm-phone-numbers. It uses the same metadata used in Android to validate phone numbers.

It’s the first release, so performance might not be the best, and there could be a whole host of bugs (hey, phone numbers are surprisingly hard), but I hope this can be of some value to the elm community :slight_smile:

Feedback very much appricated :smiley:

14 Likes

Nice, I didn’t know there actually was a way to capture all the possibilities. I’ve been told just to use a plain text field for phonenumbers, zipcodes, adresses, etc. since there are so many variations. Did you experience any edge cases where it doesn’t work?

Not yet, on the other hand I’m only testing Norwegian mobile phone numbers. There are a bunch of things I haven’t tried. There are also some phone numbers that I’m stripping out of the build (like satelite numbers)

One thing that libphonenumber, and certain ports, provide is the support for alphanumeric numbers, like 1-600-TEXT-ME. This is not supported by my library, and I don’t plan on implementing it any time soon.

In any case, if people can provide me with a test case that fails, I’d be happy to fix it.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.