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

typeof-arguments

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeof-arguments - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

14

index.js

@@ -10,9 +10,9 @@ /* global Function */

validateArguments(getArgumentsObject,getExpectedArray);
Object.keys(getExpectedArray).forEach((item)=>{
if(!ofType(getArgumentsObject[item],getExpectedArray[item])){
var actual = getActualType(getArgumentsObject[item]);
var types = getExpectedTypes(getExpectedArray[item]);
var message = `Invalid argument [${item}]. The [${actual}] ${types.truthness}argument has been passed, while the ${types.message} is expected.`;
for(var i=0;i<getExpectedArray.length;i++){
if(!ofType(getArgumentsObject[i],getExpectedArray[i])){
var actual = getActualType(getArgumentsObject[i]);
var types = getExpectedTypes(getExpectedArray[i]);
var message = `Invalid argument [${i}]. The [${actual}] ${types.truthness}argument has been passed, while the ${types.message} is expected.`;
if(clb){
callbackFunction({actual:actual,expected:types.expected,message:message,index:Number(item)});
callbackFunction({actual:actual,expected:types.expected,message:message,index:Number(i)});
return false;

@@ -24,3 +24,3 @@ } else {

}
});
}
return true;

@@ -27,0 +27,0 @@ };

{
"name": "typeof-arguments",
"version": "3.1.1",
"version": "3.1.2",
"description": "Validate the types of arguments passed to the function.",

@@ -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