se-panfilov / jsvat

Check the validity of the format of an EU VAT number
http://se-panfilov.github.io/jsvat
MIT License
131 stars 34 forks source link

feat(jsvat): detect country before validation #91

Closed belgac closed 4 years ago

belgac commented 4 years ago

this pull request allows to detect the country even if the format is invalid based on the two first characters of the vat string. This also allows to differentiate between an unsupported country and an invalid country through the formatValid key on CountryWithFormatValid type

fixes #44 fixes #65

wilgert commented 4 years ago

@se-panfilov This looks good to me. Is it OK if I merge this?

se-panfilov commented 4 years ago

I can see few minor issues, but I guess we can fix them after the merge, so I gonna give a green light for this.