lib/config.js
function merge_config(top_config, base_config)
{
    for (var option in top_config)
    {
        if (Array.isArray(top_config[option])) // handle array elements in the same order
        {
            if (!Array.isArray(base_config[option]))
                base_config[option] = top_config[option];
            else
            {
                for(var i=0;i<top_config[option].length;i++)
                {
                    if (base_config[option].length <= i)
                        base_config[option].push(top_config[option][i]);
                    else
                        merge_config(top_config[option][i],base_config[option][i]);
                }
            } 
        }
        else if (typeof top_config[option] === "Object") // recurseively handle complex configurations
        {
            if (base_config[option] === undefined)
                base_config[option] = top_config[option];
            else
                merge_config(top_config[option], base_config[option]);
        }
        else
            base_config[option] = top_config[option];
    }

}
function merge_config(top_config, base_config)
{
    for (var option in top_config)
    {
        if (Array.isArray(top_config[option])) // handle array elements in the same order
        {
            if (!Array.isArray(base_config[option]))
                base_config[option] = top_config[option];
            else
            {
                for(var i=0;i<top_config[option].length;i++)
                {
                    if (base_config[option].length <= i)
                        base_config[option].push(top_config[option][i]);
                    else
                        merge_config(top_config[option][i],base_config[option][i]);
                }
            } 
        }
        else if (typeof top_config[option] === "Object") // recurseively handle complex configurations
        {
            if (base_config[option] === undefined)
                base_config[option] = top_config[option];
            else
                merge_config(top_config[option], base_config[option]);
        }
        else
            base_config[option] = top_config[option];
    }

}
function merge_config ( top_config , base_config ) { for ( var option in top_config ) { if ( Array . isArray ( top_config [ option ] ) ) // handle array elements in the same order { if ( ! Array . isArray ( base_config [ option ] ) ) base_config [ option ] = top_config [ option ] ; else { for ( var i = 0 ; i < top_config [ option ] . length ; i ++ ) { if ( base_config [ option ] . length <= i ) base_config [ option ] . push ( top_config [ option ] [ i ] ) ; else merge_config ( top_config [ option ] [ i ] , base_config [ option ] [ i ] ) ; } } } else if ( typeof top_config [ option ] === "Object" ) // recurseively handle complex configurations { if ( base_config [ option ] === undefined ) base_config [ option ] = top_config [ option ] ; else merge_config ( top_config [ option ] , base_config [ option ] ) ; } else base_config [ option ] = top_config [ option ] ; } }
copy app_config configurations over package configurations
copy app_config configurations over package configurations