Zum Hauptinhalt springen

VatValidatorCountries

This class validates and formats VAT numbers. There's also a online validator service available (uses http://ec.europa.eu).

context.enableModules();
const { VatValidatorCountries } = require("ou.sp.validation.VatValidatorCountries");

const country = VatValidatorCountries.getCountry("de-306219982");
// country:
// {
// name: "Germany",
// code: "DE",
// patterns: ["^(DE)([1-9]\\d{8})$"],
// }

Constructors

Constructor

new VatValidatorCountries(): VatValidatorCountries

Returns

VatValidatorCountries

Properties

countrySpecs

static countrySpecs: CountryMapInternal

Methods

getCountry()

static getCountry(cleanVat): CountrySpecInternal

Parameters

cleanVat

string

Returns

CountrySpecInternal