bucks.js
function _normalizeTask(task) {
            var _task = task;
            if (task.length < 3) {
                _task = function _task(err, res, next) {
                    // wrap task with no callback
                    var result = task.call(null, err, res);
                    next.call(null, null, result);
                };
            } else if (task.length === 3) {

                // normal
                _task = task;

            } else if (task.length === 4) {

                // with index
                _task = function _task(err, res, next, index) {
                    task.call(null, err, res, next, index);
                };

            } else {
                throw new Error('args length invalid');
            }
            return _task;
        }
function _normalizeTask(task) {
            var _task = task;
            if (task.length < 3) {
                _task = function _task(err, res, next) {
                    // wrap task with no callback
                    var result = task.call(null, err, res);
                    next.call(null, null, result);
                };
            } else if (task.length === 3) {

                // normal
                _task = task;

            } else if (task.length === 4) {

                // with index
                _task = function _task(err, res, next, index) {
                    task.call(null, err, res, next, index);
                };

            } else {
                throw new Error('args length invalid');
            }
            return _task;
        }
taskの引数をラップして共通化します。
@memberof Bucks
@instance
@private
@param {Function} task ex) task(err, res, next) | task(err, res) | task(err) | task()
@throws {Error} args length invalid
@return {functio} task(err, res, next)