-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
GetProps.js
52 lines (46 loc) · 1.29 KB
/
GetProps.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var RESERVED = require('../tween/ReservedProps');
/**
* [description]
*
* @function Phaser.Tweens.Builders.GetProps
* @since 3.0.0
*
* @param {object} config - The configuration object of the tween to get the target(s) from.
*
* @return {array} An array of all the targets the tween is operating on.
*/
var GetProps = function (config)
{
var key;
var keys = [];
// First see if we have a props object
if (config.hasOwnProperty('props'))
{
for (key in config.props)
{
// Skip any property that starts with an underscore
if (key.substr(0, 1) !== '_')
{
keys.push({ key: key, value: config.props[key] });
}
}
}
else
{
for (key in config)
{
// Skip any property that is in the ReservedProps list or that starts with an underscore
if (RESERVED.indexOf(key) === -1 && key.substr(0, 1) !== '_')
{
keys.push({ key: key, value: config[key] });
}
}
}
return keys;
};
module.exports = GetProps;