compound-ex4
Version:
Compound-ex4 - MVC framework for NodeJS (ExpressJs 4 version), fork compoundjs(https://github.com/1602/compound)
16 lines (13 loc) • 363 B
JavaScript
;
var toPosInt = require('es5-ext/number/to-pos-integer');
module.exports = function (optsLength, fnLength, isAsync) {
var length;
if (isNaN(optsLength)) {
length = fnLength;
if (!(length >= 0)) return 1;
if (isAsync && length) return length - 1;
return length;
}
if (optsLength === false) return false;
return toPosInt(optsLength);
};