maybe-args

0.0.4 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    2
  • 0.0.3
    938
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i maybe-args

Weekly Downloads

940

Version

0.0.4

License

MIT

Last publish

Collaborators

  • wilhelmson