How to use the jsvat.checkVAT function in jsvat

To help you get started, we’ve selected a few jsvat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github valeriansaliou / node-sales-tax / lib / sales_tax.js View on Github external
return new __Promise(function(resolve, reject) {
            // Validate EU VAT number (valid by default)
            var validationInfo = validate_eu_vat.checkVAT(cleanTaxNumber);
            var isValid = (validationInfo.isValid && true);

            // No country match?
            if (isValid === true &&
                  ((validationInfo.country || {}).isoCode || {}).short !==
                    countryCode) {
              isValid = false;
            }

            // Check number for fraud?
            if (isValid === true && self.enabledTaxNumberFraudCheck === true) {
              // Split VAT number (n extract actual VAT number)
              var splitMatch = cleanTaxNumber.match(regex_eu_vat_split);

              // Check fraud on EU VAT number?
              if (splitMatch && splitMatch[1]) {
github se-panfilov / jsvat / src / app / common-playground / common-playground.component.ts View on Github external
updateExampleValue(vat: string | undefined, countries: ReadonlyArray): void {
    const code = checkVAT(vat, countries)
    const codeStr = JSON.stringify(code, null, 2).replace(/"(\S+)":/g, '$1:')
    if (code) this.code = highlight(codeStr, languages.javascript, 'javascript')
  }

jsvat

Check the validity of the format of an EU VAT number

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular jsvat functions