bucks.js
function _normalizeSuccess(onSuccess) {
            var _onSuccess = onSuccess;
            if (onSuccess.length < 2) {
                _onSuccess = function (res, next) {
                    var result = onSuccess(res);
                    next(null, result);
                };
            } else if (onSuccess.length === 2) {
                _onSuccess = onSuccess;
            } else {
                throw new Error('args length invalid');
            }
            return _onSuccess;
        }
function _normalizeSuccess(onSuccess) {
            var _onSuccess = onSuccess;
            if (onSuccess.length < 2) {
                _onSuccess = function (res, next) {
                    var result = onSuccess(res);
                    next(null, result);
                };
            } else if (onSuccess.length === 2) {
                _onSuccess = onSuccess;
            } else {
                throw new Error('args length invalid');
            }
            return _onSuccess;
        }
function _normalizeSuccess ( onSuccess ) { var _onSuccess = onSuccess ; if ( onSuccess . length < 2 ) { _onSuccess = function ( res , next ) { var result = onSuccess ( res ) ; next ( null , result ) ; } ; } else if ( onSuccess . length === 2 ) { _onSuccess = onSuccess ; } else { throw new Error ( 'args length invalid' ) ; } return _onSuccess ; }
thenのコールバックをラップして引数を共通化します
@memberof Bucks
@instance
@private
@param {Function} onSuccess ex) onSuccess(res, next) | onSuccess(res) | onSuccess()
@throws {Error} args length invalid
@return {function} wrappedTask onSuccess(res, next)
thenのコールバックをラップして引数を共通化します