Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
angular-jsvat
Advanced tools
Readme
Check the validity of the format of an EU VAT number. No dependencies.(except angularjs of course).
Angular-js wrapper for jsvat (jsvat it's a core-logic for vat validation)
angular-jsvat is a small library to check validity of European (and few non-eu) VAT number. (learn more about VAT) jsvat use 2-step check (see below) and didn't make any request for external resources.
Each country has own regexp for VAT number and different math-logic of number calculating.
For more details check jsvat repo.
JsVatFactory
fcatory (just an angularjs wrapper for jsvat)Just check is VAT number valid or not and which country this VAT is:
JsVatFactory.checkVAT('BG131134023'); // {isValid: true, country: 'bulgaria', value: 'BG131134023'}
JsVatFactory.checkVAT('BG0433170001'); //{isValid: false, country: null, value: 'BG0433170001'}
JsVatFactory.checkVAT('atu5-150-7409'); //{isValid: true, country: 'austria', value: 'ATU51507409'}
JsVatFactory.checkVAT('aTU 5 804 4146'); //{isValid: true, country: 'austria', value: 'ATU58044146'}
You can specify list of allowed countries
JsVatFactory.config = ['austria', 'belgium']; //All countries except 'austria' and 'belgium' would return false
JsVatFactory.checkVAT('BG131134023'); //valid VAT, but result would be 'false'
To reset config just do JsVatFactory.config = [];
jsvat
directive (for inputs).
Directive take a ngModel and return the result to the result object<input jsvat="result" type="text" ng-model="model">
bower i angular-jsvat --save
npm i angular-jsvat --save
https://github.com/se-panfilov/angular-jsvat/releases
After that, just include angular-jsvat
as a dependency
angular.module('app', ['angular-jsvat'])
(no dependencies required, angular-jsvat is standalone app)
It use jsvat core functionality:
There is 2-step check:
For example regexp for austria is /^(AT)U(\d{8})$/
.
Looks like ATU99999999
is valid (it's successfied the regexp), but actually it's should be invalid.
Here we make some mathematical calculation (different for each country).
After that we may be sure that ATU99999999
and for example ATV66889218
isn't valid, but ATU12011204
is valid.
Support all browsers down to IE9 (including IE9).
MIT: https://github.com/se-panfilov/jsvat/blob/master/LICENSE
FAQs
Check the validity of the format of an EU VAT number specified
The npm package angular-jsvat receives a total of 41 weekly downloads. As such, angular-jsvat popularity was classified as not popular.
We found that angular-jsvat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.