Comparing version 1.2.3 to 1.2.4
@@ -118,7 +118,7 @@ // VIES-VAT - bitinix@gmail.com | ||
valid: true, | ||
countryCode: await tag(response.body), | ||
vatNumber: await tag(response.body), | ||
requestDate: await tag(response.body), | ||
name: await tag(response.body), | ||
address: await tag(response.body) | ||
countryCode: await tag(response.body, 'countryCode'), | ||
vatNumber: await tag(response.body, 'vatNumber'), | ||
requestDate: await tag(response.body, 'requestDate'), | ||
name: await tag(response.body, 'name'), | ||
address: await tag(response.body, 'address') | ||
}; | ||
@@ -131,8 +131,10 @@ | ||
// Remove the tags - 26-01-23 | ||
async function tag(str) { | ||
async function tag(str, tag) { | ||
return new Promise((resolve) => { | ||
try { | ||
let fnd = new RegExp(`<ns2:${tag}>(.*?)<\/ns2:${tag}>`, 'ig'); | ||
let regex = /(<([^>]+)>)/gi; | ||
resolve(str.replace(regex, '')); | ||
str.match(fnd).map(function (val) { | ||
resolve(val.replace(regex, '')); | ||
}); | ||
} catch (e) { | ||
@@ -139,0 +141,0 @@ resolve(false); |
{ | ||
"name": "vies-vat", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "A EU VAT Number validation via European Union VIES API including company information", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -26,3 +26,3 @@ # VIES-VAT - European VAT Number Validation | ||
```bash | ||
npm install --save VIES-VAT | ||
npm install --save vies-vat | ||
``` | ||
@@ -139,3 +139,3 @@ | ||
### 1.2.3 | ||
### 1.2.4 | ||
@@ -142,0 +142,0 @@ Fix Parsing Issue<br /> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13073
166
2