public/js-roguelike-skeleton/src/util.js
function(defaults, settings) {
            var out = {};
            for (var key in defaults) {
                if (key in settings) {
                    out[key] = settings[key];
                } else {
                    out[key] = defaults[key];
                }
            }
            return out;
        }
function(defaults, settings) {
            var out = {};
            for (var key in defaults) {
                if (key in settings) {
                    out[key] = settings[key];
                } else {
                    out[key] = defaults[key];
                }
            }
            return out;
        }
function ( defaults , settings ) { var out = { } ; for ( var key in defaults ) { if ( key in settings ) { out [ key ] = settings [ key ] ; } else { out [ key ] = defaults [ key ] ; } } return out ; }
Merges settings with default values.
@method mergeDefaults
@static
@param {Object} defaults - Default values to merge with.
@param {Object} settings - Settings to merge with default values.
@return {Object} A new object with settings replacing defaults.
Merges settings with default values .