mattickx / jsvat-next

Check the validity of the format of an EU VAT number
MIT License
9 stars 0 forks source link

Cannot add country with VAT number that does not start with country code #10

Open intarsz opened 3 months ago

intarsz commented 3 months ago

I tried adding VAT validation for Canada following example: https://github.com/mattickx/jsvat-next?tab=readme-ov-file#extend-countries-list---add-your-own-country

But it does not work as VAT numbers of Canada do not start with the country code and the country code check is hardcoded in countriesVATDoesNotStartWithCountryCode https://github.com/mattickx/jsvat-next/blob/master/src/lib/jsvat.ts#L64 and cannot be overridden. It should be set as part of Country, then it would work.

mattickx commented 1 month ago

Could you create a PR with your current implementation of the VAT validation of Canadian VAT numbers please. Thank you in advance.