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

swiz

Package Overview
Dependencies
Maintainers
4
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiz - npm Package Compare versions

Comparing version 0.4.25 to 0.4.26

21

lib/valve.js

@@ -230,2 +230,23 @@ /*

/**
* Return validator at the specified position.
*
* @param {String} name Validator name.
* @return {Object|null} Validator object or null if not found.
*/
Chain.prototype.getValidatorAtPos = function(pos) {
var i, len, validator;
for (i = 0, len = this.validators.length; i < len; i++) {
validator = this.validators[i];
if (validator.pos === pos) {
return validator;
}
}
return null;
};
/**
* Add a validator to the end of the array and increase the counter.

@@ -232,0 +253,0 @@ * @param {Object} validator Validator.

2

package.json

@@ -14,3 +14,3 @@ {

"description": "Serilization and Validation Framework for objects in RESTful APIs",
"version": "0.4.25",
"version": "0.4.26",
"homepage": "https://github.com/racker/node-swiz",

@@ -17,0 +17,0 @@ "repository": {

@@ -1905,3 +1905,3 @@ /*

exports['test_getValidatorPos_and_hasValidator'] = function(test, assert) {
exports['test_getValidatorPos_hasValidator_and_getValidatorAtPos'] = function(test, assert) {
var v = new V({

@@ -1923,3 +1923,6 @@ a: C().len(1).isNumeric(),

assert.equal(v.schema.b.getValidatorAtPos(2).name, 'optional');
assert.equal(v.schema.b.getValidatorAtPos(6), null);
test.finish();
};
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