0.0.4 • Published 10 years ago
maybe-args v0.0.4
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-argsusage
var maybe = require('maybe-args'),
add =maybe(function(a,b){
return a + b;
});
add(1, null) //=> ReferenceError
add(1,2) //=> 3license
MIT