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

fix(isVAT): Corrected validation for Swiss (CH) vat-number #2203

Merged
merged 5 commits into from
Mar 27, 2023

Conversation

jimmyorpheus
Copy link
Contributor

  • updated/corrected regex for Swiss vat-number validation
  • added check-number (last digit of Swiss UID) validation
  • updated/corrected test cases (valid and invalid examples)

References:
https://www.ech.ch/de/ech/ech-0097/5.2.0
https://www.estv.admin.ch/estv/de/home/mehrwertsteuer/uid/mwst-uid-nummer.html
https://en.wikipedia.org/wiki/VAT_identification_number

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@codecov
Copy link

codecov bot commented Mar 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (cb91971) 100.00% compared to head (823323e) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2203   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          106       106           
  Lines         2348      2354    +6     
  Branches       593       594    +1     
=========================================
+ Hits          2348      2354    +6     
Impacted Files Coverage Δ
src/lib/isVAT.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/lib/isVAT.js Outdated Show resolved Hide resolved
test/validators.test.js Show resolved Hide resolved
- adjust number separation rule
- edit comments in test
Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contrib! 🎉

@profnandaa profnandaa merged commit 698f4e6 into validatorjs:master Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants