Git Product home page Git Product logo

joaopfg / vat-number-validator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 210 KB

This TypeScript package provides comprehensive Value Added Tax ID number validation functionality for all countries that support it.

Home Page: https://www.npmjs.com/package/vat-number-validator

License: GNU General Public License v3.0

JavaScript 4.72% TypeScript 95.28%
npm package typescript vat vat-number vat-validation

vat-number-validator's Introduction

VAT Number Validator ๐Ÿ”๐Ÿ”๐Ÿ”

npm version build github sponsors

Why Validating VAT Codes is Important

Validating VAT (Value Added Tax) codes is crucial for businesses operating internationally or within countries with complex tax regulations. VAT codes are unique identifiers assigned to businesses for tax purposes. Ensuring the validity of these codes helps businesses avoid errors in invoicing, comply with tax laws, and prevent potential legal issues.

Benefits of Validating VAT Codes

  • Accurate Invoicing: Valid VAT codes ensure accurate invoicing, reducing the risk of financial discrepancies and payment delays.

  • Compliance with Tax Laws: Many countries have strict regulations regarding VAT registration and reporting. Validating VAT codes helps businesses comply with these laws and avoid penalties.

  • Prevention of Fraud: Invalid VAT codes may indicate fraudulent activities such as tax evasion. Validating VAT codes helps detect and prevent such fraud.

  • International Trade: Valid VAT codes are essential for businesses involved in international trade to claim VAT refunds and ensure smooth transactions.

  • Trust and Reputation: Ensuring the validity of VAT codes enhances the trust and reputation of businesses, especially when dealing with customers and partners.

Package Completeness โœ…

This TypeScript package provides comprehensive VAT code validation functionality. Unlike similar packages, it offers a more thorough validation process, minimizing false positives and ensuring accurate results.

Remaining Development Goals ๐Ÿ› ๏ธ

While the package is already robust, there are ongoing efforts to enhance its capabilities:

  • Fix False Positives: Address any false positives in the existing regular expressions to improve accuracy.
  • Exhaustive Unit Tests: Develop a comprehensive suite of unit tests to thoroughly validate the package's functionality and ensure its reliability.
  • Additional API Functionality: Expand the package's API to provide more advanced features and options for users.

Legal Notice ๐Ÿ“œ

Note for Users: This package is distributed under the GNU General Public License Version 3 (GPL-3.0). This license grants users the freedom to use, modify, and distribute the software, with the condition that any derivative works are also licensed under GPL-3.0. It's important to review and understand the terms of this license before using the package in your projects.

Contributing Guidelines ๐Ÿค

Note for Contributors: We welcome contributions to improve and enhance this package. If you'd like to contribute, please follow these guidelines:

  • Write Unit Tests: Ensure any changes or additions are accompanied by corresponding unit tests to maintain code quality and reliability.
  • Development Process: To contribute, open a pull request (PR) targeting the develop branch. This allows for collaborative development and ensures that changes are properly reviewed before merging into the main codebase.

๐Ÿงฐ Functions

โš™๏ธ isValidCountryVat

Function Type
isValidCountryVat (vat: string, country: Country) => boolean

โš™๏ธ isValidVat

Function Type
isValidVat (vat: string) => boolean

โš™๏ธ getErrorMessage

Function Type
getErrorMessage (country: Country) => string

๐Ÿ”ง Constants

โš™๏ธ countryRegexMap

Constant Type
countryRegexMap Map<Country, string>

โš™๏ธ countryErrorMessageMap

Constant Type
countryErrorMessageMap Map<Country, string>

โš™๏ธ countrySpecialCaseMap

Constant Type
countrySpecialCaseMap Map<Country, (vat: string) => boolean>

๐Ÿ”ฉ Enum

โš™๏ธ Country

Property Type Description
Albania 'Albania'
Argentina 'Argentina'
Australia 'Australia'
Austria 'Austria'
Belarus 'Belarus'
Belgium 'Belgium'
Belize 'Belize'
Bolivia 'Bolivia'
BosniaHerzegovina 'Bosnia Herzegovina'
Brazil 'Brazil'
Bulgaria 'Bulgaria'
Canada 'Canada'
Chile 'Chile'
China 'China'
Colombia 'Colombia'
CostaRica 'Costa Rica'
Croatia 'Croatia'
Cyprus 'Cyprus'
CzechRepublic 'Czech Republic'
Denmark 'Denmark'
DominicanRepublic 'Dominican Republic'
Ecuador 'Ecuador'
ElSalvador 'El Salvador'
Estonia 'Estonia'
Finland 'Finland'
France 'France'
Germany 'Germany'
Greece 'Greece'
Guatemala 'Guatemala'
Hungary 'Hungary'
Iceland 'Iceland'
India 'India'
Indonesia 'Indonesia'
Ireland 'Ireland'
IsleOfMan 'Isle of Man'
Israel 'Israel'
Italy 'Italy'
Japan 'Japan'
Kazakhstan 'Kazakhstan'
Latvia 'Latvia'
Lithuania 'Lithuania'
Luxembourg 'Luxembourg'
Malta 'Malta'
Mexico 'Mexico'
Monaco 'Monaco'
Netherlands 'Netherlands'
NewZealand 'New Zealand'
Nicaragua 'Nicaragua'
Nigeria 'Nigeria'
NorthMacedonia 'North Macedonia'
Norway 'Norway'
Paraguay 'Paraguay'
Peru 'Peru'
Philippines 'Philippines'
Poland 'Poland'
Portugal 'Portugal'
Romania 'Romania'
Russia 'Russia'
SanMarino 'San Marino'
SaudiArabia 'Saudi Arabia'
Serbia 'Serbia'
Slovakia 'Slovakia'
Slovenia 'Slovenia'
Spain 'Spain'
Sweden 'Sweden'
Switzerland 'Switzerland'
Taiwan 'Taiwan'
Turkey 'Turkey'
Ukraine 'Ukraine'
UnitedKingdom 'United Kingdom'
Uruguay 'Uruguay'
Uzbekistan 'Uzbekistan'
Venezuela 'Venezuela'

vat-number-validator's People

Contributors

joaopfg avatar vegandiet705 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

abensur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.