Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to do strict validation check #123

Open
RobbeCl opened this issue Jan 6, 2022 · 1 comment
Open

Add option to do strict validation check #123

RobbeCl opened this issue Jan 6, 2022 · 1 comment

Comments

@RobbeCl
Copy link

RobbeCl commented Jan 6, 2022

I ran into a 'bug' where the system said the VAT number is valid, when it was actually not.

checkVAT('BE0740-509975', countries) return true, because the library automatically clears the special characters (https://github.com/se-panfilov/jsvat/blob/master/src/lib/jsvat.ts#L107)

Would it be possible to add an attribute that specifies if the client actually wants to remove those characters?

I don't mind submitting a PR, if you don't have the time to implement this.

Thanks for your library!

@zurabarata
Copy link

zurabarata commented Dec 19, 2022

@se-panfilov
having the exact same issue! ☝️
checkVAT('DE124725-365', [germany]) strips the dash from the string and sees DE124725365 as a valid VAT ID.
The checkVAT function should not strip special characters from the vat-string by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants