mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
27 lines
601 B
JavaScript
27 lines
601 B
JavaScript
|
var XHRSettings = require('./XHRSettings');
|
||
|
|
||
|
// Takes two XHR Objects and creates a new object
|
||
|
|
||
|
// The new object is based on global initially, but any setting in
|
||
|
// local overrides the global value.
|
||
|
|
||
|
var MergeXHRSettings = function (global, local)
|
||
|
{
|
||
|
var output = (global === undefined) ? XHRSettings() : Object.assign(global);
|
||
|
|
||
|
if (local)
|
||
|
{
|
||
|
for (var setting in local)
|
||
|
{
|
||
|
if (local[setting] !== undefined)
|
||
|
{
|
||
|
output[setting] = local[setting];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return output;
|
||
|
};
|
||
|
|
||
|
module.exports = MergeXHRSettings;
|