Socket
Socket
Sign inDemoInstall

ee-arguments

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-arguments

assign values passed to a function to a variable by their type and optional by their index


Version published
Weekly downloads
12
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

ee-arguments

assign values passed to a function to a variable by their type and optional by their index. you may pass also a default value for each variable

installation

npm install ee-arguments

usage

// syntax
var myVariable = arg( arguments, expectedType, [defaultValue], [index] );

var   arg = require( "ee-arguments" )
	, log = require( "ee-log" );


var test = function(){
	var callback = arg( arguments, "function", function(){ log.info( "default function" ); } );
	callback();
}


// prints «default function»
test(); 

// prints «custom function»
test( function(){ log.info( "custom function" ); } );

// prints «custom function»
test( 1, null, new Error(), function(){ log.info( "custom function" ); }, "fancy_string" ); 

FAQs

Package last updated on 15 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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