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

sanitize-arguments

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanitize-arguments - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

26

lib/sanitize.js

@@ -28,15 +28,19 @@ // Module dependencies

order.some(function(type, newIndex) {
var _type = Array.isArray(type) ? type[0] : type
, found = false;
if (typeOf(_type) == "Function" && typeOf(arg) == nameOf(_type)) {
found = true;
} else if (Array.isArray(type) && type.length == 1 && typeOf(type[0]) == typeOf(arg)) {
found = true;
var found = false;
if (Array.isArray(type)) {
if (type.length == 1 && typeOf(type[0]) == typeOf(arg)) found = true;
else {
type.forEach(function(type) {
if (typeOf(type) == "Function" && typeOf(arg) == nameOf(type)) found = true;
});
}
} else if (typeOf(type) == "Function" && typeOf(arg) == nameOf(type)) {
found = true;
}
if (found) {
_args[newIndex] = arg;
if(caller) sanitized[argNames[newIndex]] = arg;
delete order[newIndex];
_args[newIndex] = arg;
if(caller) sanitized[argNames[newIndex]] = arg;
delete order[newIndex];
}

@@ -52,3 +56,3 @@

if (Array.isArray(type)) {
def = type.length > 1 ? type[1] : type[0];
def = type[type.length - 1];
_args[newIndex] = def;

@@ -55,0 +59,0 @@ if(caller) sanitized[argNames[newIndex]] = def;

{
"name": "sanitize-arguments",
"description": "Easily check function arguments",
"version": "2.0.2",
"version": "2.0.3",
"author": "Jan Buschtöns <buschtoens@gmail.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -0,0 +0,0 @@ ![sanitize-arguments — Order arguments with ease!](http://i.imgur.com/SAhDs.png)

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