Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-validation

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-validation - npm Package Compare versions

Comparing version 1.15.1 to 1.16.0

dist/jquery.validate.min.js

27

changelog.md

@@ -0,1 +1,28 @@

1.15.1 / 2016-07-22
==================
## Additional
* Fix multiple mime-type validation
* IBAN require at least 5 chars (Closes #1797, Fixes #1674)
* Correct notEqualTo jQuery reference
## Core
* Added failing test for #1805
* Fix group validation with 3 and more fields
* Fix regressions introduced in #1644 and #1657 (Closes #1800)
* Update step validation to handle floating points correctly
* Fix error when calling $.fn.rules() on a non-form element
* Call `errorPlacement` in validator scope
* Fixed issue with contenteditable elements in forms where events for single input validation would cause exceptions
## Demo
* Add links to Bootstrap and Semantic-UI demos to index.html
* Use `.on()` instead of `.validateDelegate()`
## Localization
* Added Azeri language
## Tests
* Added regression unit tests for PR #1760
1.15.0 / 2016-02-24

@@ -2,0 +29,0 @@ ==================

177

dist/additional-methods.js
/*!
* jQuery Validation Plugin v1.15.1
* jQuery Validation Plugin v1.16.0
*

@@ -147,2 +147,48 @@ * http://jqueryvalidation.org/

* Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
*
* Spanish CIF structure:
*
* [ T ][ P ][ P ][ N ][ N ][ N ][ N ][ N ][ C ]
*
* Where:
*
* T: 1 character. Kind of Organization Letter: [ABCDEFGHJKLMNPQRSUVW]
* P: 2 characters. Province.
* N: 5 characters. Secuencial Number within the province.
* C: 1 character. Control Digit: [0-9A-J].
*
* [ T ]: Kind of Organizations. Possible values:
*
* A. Corporations
* B. LLCs
* C. General partnerships
* D. Companies limited partnerships
* E. Communities of goods
* F. Cooperative Societies
* G. Associations
* H. Communities of homeowners in horizontal property regime
* J. Civil Societies
* K. Old format
* L. Old format
* M. Old format
* N. Nonresident entities
* P. Local authorities
* Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions
* R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008)
* S. Organs of State Administration and regions
* V. Agrarian Transformation
* W. Permanent establishments of non-resident in Spain
*
* [ C ]: Control Digit. It can be a number or a letter depending on T value:
* [ T ] --> [ C ]
* ------ ----------
* A Number
* B Number
* E Number
* H Number
* K Letter
* P Letter
* Q Letter
* S Letter
*
*/

@@ -152,51 +198,57 @@ $.validator.addMethod( "cifES", function( value ) {

var num = [],
controlDigit, sum, i, count, tmp, secondDigit;
var cifRegEx = new RegExp( /^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi );
var letter = value.substring( 0, 1 ), // [ T ]
number = value.substring( 1, 8 ), // [ P ][ P ][ N ][ N ][ N ][ N ][ N ]
control = value.substring( 8, 9 ), // [ C ]
all_sum = 0,
even_sum = 0,
odd_sum = 0,
i, n,
control_digit,
control_letter;
value = value.toUpperCase();
function isOdd( n ) {
return n % 2 === 0;
}
// Quick format test
if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
if ( value.length !== 9 || !cifRegEx.test( value ) ) {
return false;
}
for ( i = 0; i < 9; i++ ) {
num[ i ] = parseInt( value.charAt( i ), 10 );
}
for ( i = 0; i < number.length; i++ ) {
n = parseInt( number[ i ], 10 );
// Algorithm for checking CIF codes
sum = num[ 2 ] + num[ 4 ] + num[ 6 ];
for ( count = 1; count < 8; count += 2 ) {
tmp = ( 2 * num[ count ] ).toString();
secondDigit = tmp.charAt( 1 );
// Odd positions
if ( isOdd( i ) ) {
sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) );
// Odd positions are multiplied first.
n *= 2;
// If the multiplication is bigger than 10 we need to adjust
odd_sum += n < 10 ? n : n - 9;
// Even positions
// Just sum them
} else {
even_sum += n;
}
}
/* The first (position 1) is a letter following the following criteria:
* A. Corporations
* B. LLCs
* C. General partnerships
* D. Companies limited partnerships
* E. Communities of goods
* F. Cooperative Societies
* G. Associations
* H. Communities of homeowners in horizontal property regime
* J. Civil Societies
* K. Old format
* L. Old format
* M. Old format
* N. Nonresident entities
* P. Local authorities
* Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions
* R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008)
* S. Organs of State Administration and regions
* V. Agrarian Transformation
* W. Permanent establishments of non-resident in Spain
*/
if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) {
sum += "";
controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 );
value += controlDigit;
return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) );
all_sum = even_sum + odd_sum;
control_digit = ( 10 - ( all_sum ).toString().substr( -1 ) ).toString();
control_digit = parseInt( control_digit, 10 ) > 9 ? "0" : control_digit;
control_letter = "JABCDEFGHI".substr( control_digit, 1 ).toString();
// Control must be a digit
if ( letter.match( /[ABEH]/ ) ) {
return control === control_digit;
// Control must be a letter
} else if ( letter.match( /[KPQS]/ ) ) {
return control === control_letter;
// Can be either
} else {
return control === control_digit || control === control_letter;
}

@@ -659,3 +711,8 @@

/*
* The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain
* The NIE (Número de Identificación de Extranjero) is a Spanish tax identification number assigned by the Spanish
* authorities to any foreigner.
*
* The NIE is the equivalent of a Spaniards Número de Identificación Fiscal (NIF) which serves as a fiscal
* identification number. The CIF number (Certificado de Identificación Fiscal) is equivalent to the NIF, but applies to
* companies rather than individuals. The NIE consists of an 'X' or 'Y' followed by 7 or 8 digits then another letter.
*/

@@ -665,28 +722,24 @@ $.validator.addMethod( "nieES", function( value ) {

value = value.toUpperCase();
var nieRegEx = new RegExp( /^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi );
var validChars = "TRWAGMYFPDXBNJZSQVHLCKET",
letter = value.substr( value.length - 1 ).toUpperCase(),
number;
// Basic format test
if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
value = value.toString().toUpperCase();
// Quick format test
if ( value.length > 10 || value.length < 9 || !nieRegEx.test( value ) ) {
return false;
}
// Test NIE
//T
if ( /^[T]{1}/.test( value ) ) {
return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) );
}
// X means same number
// Y means number + 10000000
// Z means number + 20000000
value = value.replace( /^[X]/, "0" )
.replace( /^[Y]/, "1" )
.replace( /^[Z]/, "2" );
//XYZ
if ( /^[XYZ]{1}/.test( value ) ) {
return (
value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(
value.replace( "X", "0" )
.replace( "Y", "1" )
.replace( "Z", "2" )
.substring( 0, 8 ) % 23
)
);
}
number = value.length === 9 ? value.substr( 0, 8 ) : value.substr( 0, 9 );
return false;
return validChars.charAt( parseInt( number, 10 ) % 23 ) === letter;

@@ -1072,3 +1125,3 @@ }, "Please specify a valid NIE number." );

}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" );
return $;
}));
/*!
* jQuery Validation Plugin v1.15.1
* jQuery Validation Plugin v1.16.0
*

@@ -207,3 +207,3 @@ * http://jqueryvalidation.org/

// Custom selectors
$.extend( $.expr[ ":" ], {
$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support

@@ -421,3 +421,3 @@ // http://jqueryvalidation.org/blank-selector/

"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable]", delegate )
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )

@@ -1575,3 +1575,3 @@ // Support: Chrome, oldIE

}
return $;
}));

@@ -31,6 +31,6 @@ (function( factory ) {

range: $.validator.format( "رجاء إدخال عدد قيمته بين {0} و {1}" ),
max: $.validator.format( "رجاء إدخال عدد أقل من أو يساوي (0}" ),
min: $.validator.format( "رجاء إدخال عدد أكبر من أو يساوي (0}" )
max: $.validator.format( "رجاء إدخال عدد أقل من أو يساوي {0}" ),
min: $.validator.format( "رجاء إدخال عدد أكبر من أو يساوي {0}" )
} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -31,3 +31,3 @@ (function( factory ) {

} );
return $;
}));

@@ -31,3 +31,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -38,3 +38,3 @@ (function( factory ) {

} );
return $;
}));

@@ -38,3 +38,3 @@ (function( factory ) {

} );
return $;
}));

@@ -37,3 +37,3 @@ (function( factory ) {

} );
return $;
}));

@@ -32,3 +32,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -37,3 +37,3 @@ (function( factory ) {

} );
return $;
}));

@@ -32,3 +32,3 @@ (function( factory ) {

} );
return $;
}));

@@ -60,3 +60,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -39,3 +39,3 @@ (function( factory ) {

}( jQuery ) );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -33,3 +33,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -33,3 +33,3 @@ (function( factory ) {

} );
return $;
}));

@@ -32,3 +32,3 @@ (function( factory ) {

} );
return $;
}));

@@ -38,3 +38,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -44,3 +44,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -35,3 +35,3 @@ (function( factory ) {

} );
return $;
}));

@@ -35,2 +35,3 @@ (function( factory ) {

min: $.validator.format( "Por favor, forne&ccedil;a um valor maior ou igual a {0}." ),
step: $.validator.format( "Por favor, forne&ccedil;a um valor m&acute;tiplo de {0}." ),

@@ -87,3 +88,3 @@ // Metodos Adicionais

} );
return $;
}));

@@ -38,3 +38,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -31,3 +31,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -32,3 +32,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -35,3 +35,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -35,3 +35,3 @@ (function( factory ) {

} );
return $;
}));

@@ -34,3 +34,3 @@ (function( factory ) {

} );
return $;
}));

@@ -23,3 +23,3 @@ (function( factory ) {

} );
return $;
}));

@@ -23,3 +23,3 @@ (function( factory ) {

} );
return $;
}));

@@ -23,3 +23,3 @@ (function( factory ) {

} );
return $;
}));

@@ -20,3 +20,3 @@ (function( factory ) {

} );
return $;
}));

@@ -20,3 +20,3 @@ (function( factory ) {

} );
return $;
}));

@@ -5,3 +5,3 @@ {

"description": "Client-side form validation made easy",
"version": "1.15.1",
"version": "1.16.0",
"homepage": "http://jqueryvalidation.org/",

@@ -34,20 +34,22 @@ "license": "MIT",

"dist/additional-methods.js",
"dist/jquery.validate.js"
"dist/jquery.validate.js",
"dist/jquery.validate.min.js"
],
"main": "dist/jquery.validate.js",
"dependencies": {
"jquery": "^1.7 || ^2.0"
"jquery": "^1.7 || ^2.0 || ^3.1"
},
"devDependencies": {
"commitplease": "^2.2.3",
"grunt": "^0.4.4",
"grunt-contrib-compress": "^0.7",
"grunt-contrib-concat": "^0.3",
"grunt-contrib-copy": "^0.5",
"grunt-contrib-jshint": "^0.11.3",
"grunt-contrib-qunit": "^0.4",
"grunt-contrib-uglify": "^0.4",
"grunt-contrib-watch": "^0.6",
"grunt-jscs": "^2.2",
"grunt-text-replace": "^0.3.11"
"commitplease": "2.3.1",
"grunt": "1.0.1",
"grunt-contrib-compress": "1.2.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-jshint": "1.0.0",
"grunt-contrib-qunit": "1.2.0",
"grunt-contrib-uglify": "1.0.1",
"grunt-contrib-watch": "1.0.0",
"grunt-jscs": "2.8.0",
"grunt-text-replace": "0.4.0",
"qunitjs": "2.0.0"
},

@@ -54,0 +56,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc