Socket
Socket
Sign inDemoInstall

@accountable/jsvat

Package Overview
Dependencies
0
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.1

LICENCE

2

lib/cjs/index.js

@@ -19,4 +19,4 @@ "use strict";

const jsvat_organizer_1 = require("./jsvat.organizer");
exports.countries = (0, jsvat_organizer_1.getCountriesMap)();
exports.countries = jsvat_organizer_1.countriesMap;
__exportStar(require("./jsvat.index"), exports);
__exportStar(require("./jsvat.type"), exports);

@@ -5,3 +5,2 @@ "use strict";

const jsvat_organizer_1 = require("./jsvat.organizer");
const countriesMap = (0, jsvat_organizer_1.getCountriesMap)();
/*

@@ -39,3 +38,3 @@ * This is a copy of the original jsvat package, but with the following changes:

}
const countriesVATDoesNotStartWithCountryCode = [countriesMap.brazil.name];
const countriesVATDoesNotStartWithCountryCode = [jsvat_organizer_1.countriesMap.brazil.name];
function isVATStartWithCountryCode(countryName) {

@@ -75,3 +74,3 @@ return !countriesVATDoesNotStartWithCountryCode.includes(countryName);

}
exports.countries = Object.values(countriesMap);
exports.countries = Object.values(jsvat_organizer_1.countriesMap);
function checkVAT(vat, countriesList = exports.countries) {

@@ -78,0 +77,0 @@ if (!vat)

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
Object.defineProperty(exports, "__esModule", { value: true });
exports.countriesMap = void 0;
const andorra_1 = require("./countries/andorra");
const austria_1 = require("./countries/austria");
const belgium_1 = require("./countries/belgium");
const brazil_1 = require("./countries/brazil");
const bulgaria_1 = require("./countries/bulgaria");
const croatia_1 = require("./countries/croatia");
const cyprus_1 = require("./countries/cyprus");
const czechRepublic_1 = require("./countries/czechRepublic");
const denmark_1 = require("./countries/denmark");
const estonia_1 = require("./countries/estonia");
const europe_1 = require("./countries/europe");
const finland_1 = require("./countries/finland");
const france_1 = require("./countries/france");
const germany_1 = require("./countries/germany");
const greece_1 = require("./countries/greece");
const hungary_1 = require("./countries/hungary");
const ireland_1 = require("./countries/ireland");
const italy_1 = require("./countries/italy");
const latvia_1 = require("./countries/latvia");
const lithuania_1 = require("./countries/lithuania");
const luxembourg_1 = require("./countries/luxembourg");
const malta_1 = require("./countries/malta");
const netherlands_1 = require("./countries/netherlands");
const norway_1 = require("./countries/norway");
const poland_1 = require("./countries/poland");
const portugal_1 = require("./countries/portugal");
const romania_1 = require("./countries/romania");
const russia_1 = require("./countries/russia");
const serbia_1 = require("./countries/serbia");
const slovakiaRepublic_1 = require("./countries/slovakiaRepublic");
const slovenia_1 = require("./countries/slovenia");
const spain_1 = require("./countries/spain");
const sweden_1 = require("./countries/sweden");
const switzerland_1 = require("./countries/switzerland");
const unitedKingdom_1 = require("./countries/unitedKingdom");
exports.countriesMap = {
andorra: andorra_1.andorra,
austria: austria_1.austria,
belgium: belgium_1.belgium,
brazil: brazil_1.brazil,
bulgaria: bulgaria_1.bulgaria,
croatia: croatia_1.croatia,
cyprus: cyprus_1.cyprus,
czechRepublic: czechRepublic_1.czechRepublic,
denmark: denmark_1.denmark,
estonia: estonia_1.estonia,
europe: europe_1.europe,
finland: finland_1.finland,
france: france_1.france,
germany: germany_1.germany,
greece: greece_1.greece,
hungary: hungary_1.hungary,
ireland: ireland_1.ireland,
italy: italy_1.italy,
latvia: latvia_1.latvia,
lithuania: lithuania_1.lithuania,
luxembourg: luxembourg_1.luxembourg,
malta: malta_1.malta,
netherlands: netherlands_1.netherlands,
norway: norway_1.norway,
poland: poland_1.poland,
portugal: portugal_1.portugal,
romania: romania_1.romania,
russia: russia_1.russia,
serbia: serbia_1.serbia,
slovakiaRepublic: slovakiaRepublic_1.slovakiaRepublic,
slovenia: slovenia_1.slovenia,
spain: spain_1.spain,
sweden: sweden_1.sweden,
switzerland: switzerland_1.switzerland,
unitedKingdom: unitedKingdom_1.unitedKingdom,
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCountriesMap = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
function getCountriesMap() {
// * read all files in current directory
const countryFilesNames = fs_1.default.readdirSync(path_1.default.join(__dirname, 'countries'));
const countriesToHandlerMap = {};
// * import all files and add them to the map
for (const countryFileName of countryFilesNames) {
const [countryName] = countryFileName.split('.');
const countryFilePath = path_1.default.join(__dirname, 'countries', countryName);
const countryFileData = require(countryFilePath);
countriesToHandlerMap[countryName] = countryFileData[countryName];
}
return countriesToHandlerMap;
}
exports.getCountriesMap = getCountriesMap;

@@ -1,4 +0,40 @@

export declare const countries: Record<import("./jsvat.type").Country, import("./jsvat.type").CountryConfig>;
export declare const countries: {
andorra: import("./jsvat.type").CountryConfig;
austria: import("./jsvat.type").CountryConfig;
belgium: import("./jsvat.type").CountryConfig;
brazil: import("./jsvat.type").CountryConfig;
bulgaria: import("./jsvat.type").CountryConfig;
croatia: import("./jsvat.type").CountryConfig;
cyprus: import("./jsvat.type").CountryConfig;
czechRepublic: import("./jsvat.type").CountryConfig;
denmark: import("./jsvat.type").CountryConfig;
estonia: import("./jsvat.type").CountryConfig;
europe: import("./jsvat.type").CountryConfig;
finland: import("./jsvat.type").CountryConfig;
france: import("./jsvat.type").CountryConfig;
germany: import("./jsvat.type").CountryConfig;
greece: import("./jsvat.type").CountryConfig;
hungary: import("./jsvat.type").CountryConfig;
ireland: import("./jsvat.type").CountryConfig;
italy: import("./jsvat.type").CountryConfig;
latvia: import("./jsvat.type").CountryConfig;
lithuania: import("./jsvat.type").CountryConfig;
luxembourg: import("./jsvat.type").CountryConfig;
malta: import("./jsvat.type").CountryConfig;
netherlands: import("./jsvat.type").CountryConfig;
norway: import("./jsvat.type").CountryConfig;
poland: import("./jsvat.type").CountryConfig;
portugal: import("./jsvat.type").CountryConfig;
romania: import("./jsvat.type").CountryConfig;
russia: import("./jsvat.type").CountryConfig;
serbia: import("./jsvat.type").CountryConfig;
slovakiaRepublic: import("./jsvat.type").CountryConfig;
slovenia: import("./jsvat.type").CountryConfig;
spain: import("./jsvat.type").CountryConfig;
sweden: import("./jsvat.type").CountryConfig;
switzerland: import("./jsvat.type").CountryConfig;
unitedKingdom: import("./jsvat.type").CountryConfig;
};
export * from './jsvat.index';
export * from './jsvat.type';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,39 @@

import { Country, CountryConfig } from './jsvat.type';
export declare function getCountriesMap(): Record<Country, CountryConfig>;
import { CountryConfig } from './jsvat.type';
export declare const countriesMap: {
andorra: CountryConfig;
austria: CountryConfig;
belgium: CountryConfig;
brazil: CountryConfig;
bulgaria: CountryConfig;
croatia: CountryConfig;
cyprus: CountryConfig;
czechRepublic: CountryConfig;
denmark: CountryConfig;
estonia: CountryConfig;
europe: CountryConfig;
finland: CountryConfig;
france: CountryConfig;
germany: CountryConfig;
greece: CountryConfig;
hungary: CountryConfig;
ireland: CountryConfig;
italy: CountryConfig;
latvia: CountryConfig;
lithuania: CountryConfig;
luxembourg: CountryConfig;
malta: CountryConfig;
netherlands: CountryConfig;
norway: CountryConfig;
poland: CountryConfig;
portugal: CountryConfig;
romania: CountryConfig;
russia: CountryConfig;
serbia: CountryConfig;
slovakiaRepublic: CountryConfig;
slovenia: CountryConfig;
spain: CountryConfig;
sweden: CountryConfig;
switzerland: CountryConfig;
unitedKingdom: CountryConfig;
};
//# sourceMappingURL=jsvat.organizer.d.ts.map
{
"name": "@accountable/jsvat",
"version": "1.0.1",
"version": "1.1.1",
"description": "Check the validity of the format of a VAT number",
"exports": {
".": {
"import": {
"types": "./lib/esm/types/index.d.ts",
"default": "./lib/esm/index.mjs"
},
"require": {

@@ -24,4 +20,3 @@ "types": "./lib/cjs/types/index.d.ts",

"clean": "rm -rf ./lib",
"build": "npm run clean && npm run build:esm && npm run build:cjs",
"build:esm": "tsc -p ./configs/tsconfig.esm.json && mv lib/esm/index.js lib/esm/index.mjs",
"build": "npm run clean && npm run build:cjs",
"build:cjs": "tsc -p ./configs/tsconfig.cjs.json",

@@ -28,0 +23,0 @@ "test": "jest",

@@ -1,4 +0,15 @@

# @accountable/jsvat
<h1><p align="center">@accountable/jsvat</p></h1>
Check the validity of the format of a VAT number. No dependencies.
<p align="center">Check the validity of the format of a VAT number. No dependencies</p>
<p align="center">
<a href="https://www.npmjs.com/package/@accountable/jsvat">
<img src="https://img.shields.io/npm/v/@accountable/jsvat.svg?style=flat-square&amp;logo=npm" alt="npm">
</a>
<a href="http://makeapullrequest.com">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome">
</a>
<a href="https://github.com/@accountable/jsvat/blob/master/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="GitHub license">
</a>
</p>

@@ -5,0 +16,0 @@ ## Disclaimer

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc