/**
 * @author jerry hamlet <jerry@hamletink.com>
 */
var _ = require('underscore');
/**
 * @param {...Mixed}
 * @returns {Object}
 */
function hashify () {
    var args = _.rest(arguments, 0);
    return _.object(args, args);
}

function enumerate () {
    return _.reduce(arguments, function (acc, cur, idx) {
        acc[cur] = idx + 1;
        return acc;
    }, {});
}
/**
 * @param {String} name Name of the function to alias.
 * @param {Object} [scope] Optional scope to use. If not given, uses the current 'this'.
 * @param {Mixed[]} [args] Optional list of arguments to prepend when calling
 *      the aliased function.
 * @returns {Function}
 */
function alias (name, scope, args) {
    if (arguments.length < 3 && _.isArray(scope)) {
        args = scope;
        scope = null;
    }
    
    args = args || [];
    
    return function () {
        var obj = scope || this,
            fn = obj[name];
        
        return fn.apply(obj, args.concat(_.rest(arguments, 0)));
    };
}

_.extend(exports, _, {
    hashify: hashify,
    enumerate: enumerate,
    alias: alias
});

/**
 * @author jerry hamlet <jerry@hamletink.com>
 */
var _ = require('underscore');
module.exports = _;

/**
 * @param {...Mixed}
 * @returns {Object}
 */
function hashify () {
    var args = _.rest(arguments, 0);
    return _.object(args, args);
}

function enumerate () {
    return _.reduce(arguments, function (acc, cur, idx) {
        acc[cur] = idx + 1;
        return acc;
    }, {});
}
/**
 * @param {String} name Name of the function to alias.
 * @param {Object} [scope] Optional scope to use. If not given, uses the current 'this'.
 * @param {Mixed[]} [args] Optional list of arguments to prepend when calling
 *      the aliased function.
 * @returns {Function}
 */
function alias (name, scope, args) {
    if (arguments.length < 3 && _.isArray(scope)) {
        args = scope;
        scope = null;
    }
    
    args = args || [];
    
    return function () {
        var obj = scope || this,
            fn = obj[name];
        
        return fn.apply(obj, args.concat(_.rest(arguments, 0)));
    };
}

_.mixin({
    hashify: hashify,
    enumerate: enumerate,
    alias: alias
});

Use underscore's mixin functionality.