Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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]) {
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')
}