@accountable/jsvat
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -17,5 +17,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unitedKingdom = exports.switzerland = exports.sweden = exports.spain = exports.slovenia = exports.slovakiaRepublic = exports.serbia = exports.russia = exports.romania = exports.portugal = exports.poland = exports.norway = exports.netherlands = exports.malta = exports.luxembourg = exports.lithuania = exports.latvia = exports.italy = exports.ireland = exports.hungary = exports.greece = exports.germany = exports.france = exports.finland = exports.europe = exports.estonia = exports.denmark = exports.czechRepublic = exports.cyprus = exports.croatia = exports.bulgaria = exports.brazil = exports.belgium = exports.austria = exports.andorra = exports.countries = void 0; | ||
exports.unitedKingdom = exports.switzerland = exports.sweden = exports.spain = exports.slovenia = exports.slovakiaRepublic = exports.serbia = exports.russia = exports.romania = exports.portugal = exports.poland = exports.norway = exports.netherlands = exports.malta = exports.luxembourg = exports.lithuania = exports.latvia = exports.italy = exports.ireland = exports.hungary = exports.greece = exports.germany = exports.france = exports.finland = exports.europe = exports.estonia = exports.denmark = exports.czechRepublic = exports.cyprus = exports.croatia = exports.bulgaria = exports.brazil = exports.belgium = exports.austria = exports.andorra = exports.countriesMap = exports.countries = void 0; | ||
var jsvat_organizer_1 = require("./jsvat.organizer"); | ||
Object.defineProperty(exports, "countries", { enumerable: true, get: function () { return jsvat_organizer_1.countries; } }); | ||
Object.defineProperty(exports, "countriesMap", { enumerable: true, get: function () { return jsvat_organizer_1.countriesMap; } }); | ||
Object.defineProperty(exports, "andorra", { enumerable: true, get: function () { return jsvat_organizer_1.andorra; } }); | ||
@@ -22,0 +23,0 @@ Object.defineProperty(exports, "austria", { enumerable: true, get: function () { return jsvat_organizer_1.austria; } }); |
@@ -37,3 +37,3 @@ "use strict"; | ||
} | ||
const countriesVATDoesNotStartWithCountryCode = [jsvat_organizer_1.countries.brazil.name]; | ||
const countriesVATDoesNotStartWithCountryCode = [jsvat_organizer_1.countriesMap.brazil.name]; | ||
function isVATStartWithCountryCode(countryName) { | ||
@@ -73,3 +73,3 @@ return !countriesVATDoesNotStartWithCountryCode.includes(countryName); | ||
} | ||
function checkVAT(vat, countriesList = Object.values(jsvat_organizer_1.countries)) { | ||
function checkVAT(vat, countriesList = jsvat_organizer_1.countries) { | ||
if (!vat) | ||
@@ -76,0 +76,0 @@ return makeResult(vat, false); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.countries = exports.unitedKingdom = exports.switzerland = exports.sweden = exports.spain = exports.slovenia = exports.slovakiaRepublic = exports.serbia = exports.russia = exports.romania = exports.portugal = exports.poland = exports.norway = exports.netherlands = exports.malta = exports.luxembourg = exports.lithuania = exports.latvia = exports.italy = exports.ireland = exports.hungary = exports.greece = exports.germany = exports.france = exports.finland = exports.europe = exports.estonia = exports.denmark = exports.czechRepublic = exports.cyprus = exports.croatia = exports.bulgaria = exports.brazil = exports.belgium = exports.austria = exports.andorra = void 0; | ||
exports.countries = exports.countriesMap = exports.unitedKingdom = exports.switzerland = exports.sweden = exports.spain = exports.slovenia = exports.slovakiaRepublic = exports.serbia = exports.russia = exports.romania = exports.portugal = exports.poland = exports.norway = exports.netherlands = exports.malta = exports.luxembourg = exports.lithuania = exports.latvia = exports.italy = exports.ireland = exports.hungary = exports.greece = exports.germany = exports.france = exports.finland = exports.europe = exports.estonia = exports.denmark = exports.czechRepublic = exports.cyprus = exports.croatia = exports.bulgaria = exports.brazil = exports.belgium = exports.austria = exports.andorra = void 0; | ||
const andorra_1 = require("./countries/andorra"); | ||
@@ -74,3 +74,3 @@ Object.defineProperty(exports, "andorra", { enumerable: true, get: function () { return andorra_1.andorra; } }); | ||
Object.defineProperty(exports, "unitedKingdom", { enumerable: true, get: function () { return unitedKingdom_1.unitedKingdom; } }); | ||
exports.countries = { | ||
exports.countriesMap = { | ||
andorra: andorra_1.andorra, | ||
@@ -112,1 +112,2 @@ austria: austria_1.austria, | ||
}; | ||
exports.countries = Object.values(exports.countriesMap); |
@@ -1,4 +0,4 @@ | ||
export { countries, andorra, austria, belgium, brazil, bulgaria, croatia, cyprus, czechRepublic, denmark, estonia, europe, finland, france, germany, greece, hungary, ireland, italy, latvia, lithuania, luxembourg, malta, netherlands, norway, poland, portugal, romania, russia, serbia, slovakiaRepublic, slovenia, spain, sweden, switzerland, unitedKingdom, } from './jsvat.organizer'; | ||
export { countries, countriesMap, andorra, austria, belgium, brazil, bulgaria, croatia, cyprus, czechRepublic, denmark, estonia, europe, finland, france, germany, greece, hungary, ireland, italy, latvia, lithuania, luxembourg, malta, netherlands, norway, poland, portugal, romania, russia, serbia, slovakiaRepublic, slovenia, spain, sweden, switzerland, unitedKingdom, } from './jsvat.organizer'; | ||
export * from './jsvat.index'; | ||
export * from './jsvat.type'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -37,3 +37,3 @@ import { andorra } from './countries/andorra'; | ||
export { andorra, austria, belgium, brazil, bulgaria, croatia, cyprus, czechRepublic, denmark, estonia, europe, finland, france, germany, greece, hungary, ireland, italy, latvia, lithuania, luxembourg, malta, netherlands, norway, poland, portugal, romania, russia, serbia, slovakiaRepublic, slovenia, spain, sweden, switzerland, unitedKingdom, }; | ||
export declare const countries: { | ||
export declare const countriesMap: { | ||
andorra: import("./jsvat.type").CountryConfig; | ||
@@ -75,2 +75,3 @@ austria: import("./jsvat.type").CountryConfig; | ||
}; | ||
export declare const countries: import("./jsvat.type").CountryConfig[]; | ||
//# sourceMappingURL=jsvat.organizer.d.ts.map |
{ | ||
"name": "@accountable/jsvat", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Check the validity of the format of a VAT number", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -74,5 +74,5 @@ <h1><p align="center">@accountable/jsvat</p></h1> | ||
```javascript | ||
import { checkVAT, countries } from '@accountable/jsvat'; | ||
import { checkVAT, countriesMap } from '@accountable/jsvat'; | ||
const { france, germany, ...countriesToValidate } = countries; | ||
const { france, germany, ...countriesToValidate } = countriesMap; | ||
@@ -79,0 +79,0 @@ checkVAT('BE0411905847', countriesToValidate); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
95528
1819