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

Library interface #87

Open sandstrom opened 5 years ago

sandstrom commented 5 years ago

Thanks for a great library!

Two thoughts:

  1. It's slightly cumbersome to import the countries. Have you considered adjusting the interface to something like this:
import { lookup } from 'jsvat'; 

let response = lookup('BE0411905847');
// where response would be the current response object
  1. Perhaps there could be a property for groups of countries in the response, e.g. blocs: ['eu'], so one could quickly check if a VAT number is within the EU VAT scheme. Could add more relevant blocks in the future if needed.

Happy to hear your thoughts!