bail-out
Takes all parameters but the last (the callback) and calls the callback with the first parameters on process.nextTick
. Use case is where you need to bail out early many times e.g. during validation.
It will not save your ass like dezalgo
does.
Install
$ npm install bail-out --save
Usage
With bail-out
.
var bail = var fs = var path = var home = { if typeof optsfoo != 'string' return fs} { if typeof optsbar != 'number' return fs}
Without bail-out
.
var fs = var path = var home = { if typeof optsfoo != 'string' return process fs} { if typeof optsbar != 'number' return process fs
License
All code, unless stated otherwise, is licensed under the WTFPL
.