maybe-args

wraps a function in null/undefined guards. checks that all arguments have some value. shouldn't be used ifnull or undefined is acceptable for any arguments.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
maybe-args
200.0.48 years ago10 years agoMinified + gzip package size for maybe-args in KB

Readme

maybe-args
A simple function decorator to check that all arguments passed to a function are 'something' (not null or undefined). Influenced by JavaScript Allonge, and, as it happens, basically the same as what you find in Allong.es.
Also supports curried functions.
install
npm install maybe-args
usage
var maybe = require('maybe-args'),
	add =maybe(function(a,b){
		return a + b;
	});

add(1, null) //=> ReferenceError
add(1,2) //=> 3
license
MIT