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

whitelister

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whitelister - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

15

lib/errors.js

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

const { isFunc } = require('./helpers');
module.exports.BaseError = class extends Error {

@@ -7,2 +9,8 @@ constructor(msg = '') {

}
toJSON() {
return {
message: this.message,
};
}
};

@@ -51,5 +59,10 @@

this.addToMessage(err.message);
} else {
} else if (isFunc(err.toJSON)) {
this.errors.push(err.toJSON());
this.addToMessage(err.toString());
} else {
this.errors.push({
message: err.toString(),
});
this.addToMessage(err.message || err.toString());
}

@@ -56,0 +69,0 @@ });

2

lib/whitelister.js

@@ -95,3 +95,3 @@ const { ArgumentError, FieldError, WhitelistError } = require('./errors');

filteredParams[name] = val;
} else if (has.call(params, name)) {
} else if (has.call(params, name) && isDefined(params[name])) {
val = params[name];

@@ -98,0 +98,0 @@ if (val === null && (rule.allowNull || rule.type === 'null')) {

{
"name": "whitelister",
"version": "0.0.4",
"version": "0.0.5",
"description": "Simple, basic filtering and validation tool for Node.js.",

@@ -5,0 +5,0 @@ "main": "whitelister.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