New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mastercheck

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mastercheck - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

66

lib/mastercheck.js

@@ -41,5 +41,5 @@ /**

Number: function(option) {
option = option || {};
this.option = option || {};
this.check = function(data) {
if (!option.required && data === undefined) {
if (!this.option.required && data === undefined) {
return;

@@ -53,7 +53,7 @@ }

}
if (option.hasOwnProperty('min') && option.min > data) {
return data + ' should be above ' + option.min;
if (this.option.hasOwnProperty('min') && this.option.min > data) {
return data + ' should be above ' + this.option.min;
}
if (option.hasOwnProperty('max') && option.max < data) {
return data + ' should be below ' + option.max;
if (this.option.hasOwnProperty('max') && this.option.max < data) {
return data + ' should be below ' + this.option.max;
}

@@ -75,5 +75,5 @@ };

String: function(option) {
option = option || {};
this.option = option || {};
this.check = function(data) {
if (!option.required && data === undefined) {
if (!this.option.required && data === undefined) {
return;

@@ -87,13 +87,13 @@ }

}
if (option.hasOwnProperty('minLength') && option.minLength > data.length) {
return data + ' length should be above ' + option.minLength;
if (this.option.hasOwnProperty('minLength') && this.option.minLength > data.length) {
return data + ' length should be above ' + this.option.minLength;
}
if (option.hasOwnProperty('maxLength') && option.maxLength < data.length) {
return data + ' length should be below ' + option.maxLength;
if (this.option.hasOwnProperty('maxLength') && this.option.maxLength < data.length) {
return data + ' length should be below ' + this.option.maxLength;
}
if (option.hasOwnProperty('match') && !data.match(option.match)) {
return data + ' should match ' + option.match;
if (this.option.hasOwnProperty('match') && !data.match(this.option.match)) {
return data + ' should match ' + this.option.match;
}
if (option.hasOwnProperty('select') && !~option.select.indexOf(data)) {
return data + ' should match ' + option.select.join(' or ');
if (this.option.hasOwnProperty('select') && !~this.option.select.indexOf(data)) {
return data + ' should match ' + this.option.select.join(' or ');
}

@@ -112,5 +112,5 @@ };

Boolean: function(option) {
option = option || {};
this.option = option || {};
this.check = function(data) {
if (!option.required && data === undefined) {
if (!this.option.required && data === undefined) {
return;

@@ -137,5 +137,5 @@ }

Object: function(option, format) {
option = option || {};
this.option = option || {};
this.check = function(data) {
if (!option.required && data === undefined) {
if (!this.option.required && data === undefined) {
return;

@@ -165,5 +165,5 @@ }

Array: function(option, format) {
option = option || {};
this.option = option || {};
this.check = function(data) {
if (!option.required && data === undefined) {
if (!this.option.required && data === undefined) {
return;

@@ -177,7 +177,7 @@ }

}
if (option.hasOwnProperty('minLength') && option.minLength > data.length) {
return data + ' length should be above ' + option.minLength;
if (this.option.hasOwnProperty('minLength') && this.option.minLength > data.length) {
return data + ' length should be above ' + this.option.minLength;
}
if (option.hasOwnProperty('maxLength') && option.maxLength < data.length) {
return data + ' length should be below ' + option.maxLength;
if (this.option.hasOwnProperty('maxLength') && this.option.maxLength < data.length) {
return data + ' length should be below ' + this.option.maxLength;
}

@@ -199,12 +199,12 @@ };

Map: function(option, format) {
option = option || {};
this.option = option || {};
this.check = function(data) {
if (option.hasOwnProperty('maxLength') && option.maxLength < data.length) {
return data + ' length should be above ' + option.maxLength;
if (this.option.hasOwnProperty('maxLength') && this.option.maxLength < data.length) {
return data + ' length should be above ' + this.option.maxLength;
}
if (option.hasOwnProperty('match') && !data.match(option.match)) {
return data + ' should match ' + option.match;
if (this.option.hasOwnProperty('match') && !data.match(this.option.match)) {
return data + ' should match ' + this.option.match;
}
if (option.hasOwnProperty('select') && !~option.select.indexOf(data)) {
return data + ' should match ' + option.select;
if (this.option.hasOwnProperty('select') && !~this.option.select.indexOf(data)) {
return data + ' should match ' + this.option.select;
}

@@ -211,0 +211,0 @@ };

{
"name": "mastercheck",
"version": "0.2.2",
"version": "0.2.3",
"description": "mastercheck",

@@ -5,0 +5,0 @@ "main": "index.js",

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