Skip to content

A simple function decorator to check that all args passed to a function are not nothing (null/undefined)

Notifications You must be signed in to change notification settings

thunklife/maybe-args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple function decorator to check that all args passed to a function are not nothing (null/undefined)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •