isVAT
Using this method, you can check whether the received input is a VAT number or not
Params
isVAT(VAT,regions = []);
- VAT → VAT Write the string you want to check whether it is a VAT number or not in this parameter and pass it to the function
- regions → An array of regions where the VAT number must be in the form of one of these regions to return true, if this parameter is not given, all possible regions will be checked by default.
regions
The text format of the region string is exactly the same as the express-validator package
Returns
true | false
- Boolean → If the input string is a VAT number, it returns true and if the input string is not a VAT number, it returns false.
Usage
isVAT("DE494050532", ["de-DE"]); //true
isVAT("AL494320431", ['de-DE']); //false