catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.79k stars 216 forks source link

Fix argument type of `isSupportedCountry` helper #310

Closed richeterre closed 5 years ago

richeterre commented 5 years ago

Since the whole point of the helper is to check whether an arbitrary string is a valid country code supported by the library, we should accept any string here. For instance, the example code isSupportedCountry("XX") causes a compiler error, because "XX" is not part of the CountryCode union type.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 2f6589553c2e99a63496d8d288a1cd09349f0dc1 on richeterre:patch-1 into 44c75fc4fc956b0765bfea676c6bb2083536695d on catamphetamine:master.

catamphetamine commented 5 years ago

@richeterre Indeed. Published libphonenumber-js@1.7.14.