mirror of
https://github.com/photonstorm/phaser
synced 2024-12-24 20:13:35 +00:00
26 lines
426 B
JavaScript
26 lines
426 B
JavaScript
|
var GetValue = require('../../utils/object/GetValue');
|
||
|
|
||
|
var GetTargets = function (config)
|
||
|
{
|
||
|
var targets = GetValue(config, 'targets', null);
|
||
|
|
||
|
if (targets === null)
|
||
|
{
|
||
|
return targets;
|
||
|
}
|
||
|
|
||
|
if (typeof targets === 'function')
|
||
|
{
|
||
|
targets = targets.call();
|
||
|
}
|
||
|
|
||
|
if (!Array.isArray(targets))
|
||
|
{
|
||
|
targets = [ targets ];
|
||
|
}
|
||
|
|
||
|
return targets;
|
||
|
};
|
||
|
|
||
|
module.exports = GetTargets;
|