lib/index.js
function merge(need, options, level){
    // 如果没有传第三个参数，默认无限递归右边覆盖左边
    if (level == undefined) level = -1;
    if (options === undefined) options = {};
    if (need.length == 1) return need[0];
    var res = {};
    for (var i = 0; i < need.length; i++){
        _merge(res, need[i], options, level - 1);
    }
    return res;
}
function merge(need, options, level){
    // 如果没有传第三个参数，默认无限递归右边覆盖左边
    if (level == undefined) level = -1;
    if (options === undefined) options = {};
    if (need.length == 1) return need[0];
    var res = {};
    for (var i = 0; i < need.length; i++){
        _merge(res, need[i], options, level - 1);
    }
    return res;
}
function merge ( need , options , level ) { // 如果没有传第三个参数，默认无限递归右边覆盖左边 if ( level == undefined ) level = - 1 ; if ( options === undefined ) options = { } ; if ( need . length == 1 ) return need [ 0 ] ; var res = { } ; for ( var i = 0 ; i < need . length ; i ++ ) { _merge ( res , need [ i ] , options , level - 1 ) ; } return res ; }
global merge function
@param  {Array} need    need to merge
@param  {Object} options options for merge method
@param  {Number} level  merge level
@return {Object}         the result of merges
global merge function