File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file Serializable properties helper
3
+ */
4
+ /*#ifndef(UMD)*/
5
+ "use strict" ;
6
+ /*global _gpfAttributesGet*/ // Get attributes defined for the object / class
7
+ /*global _gpfAttributesSerializable*/ // Shortcut for gpf.attributes.Serializable
8
+ /*global _gpfObjectForEach*/ // Similar to [].forEach but for objects
9
+ /*exported _gpfSerialGet*/ // Collect gpf.typedef.serializableProperty defined for the object / class
10
+ /*#endif*/
11
+
12
+ /**
13
+ * Collect {@link gpf.typedef.serializableProperty} defined for the object / class
14
+ *
15
+ * @param {Object|Function } objectOrClass Object instance or class constructor
16
+ * @return {Object } Dictionary of {@link gpf.typedef.serializableProperty} index by member
17
+ */
18
+ function _gpfSerialGet ( objectOrClass ) {
19
+ var serializable = _gpfAttributesGet ( objectOrClass , _gpfAttributesSerializable ) ,
20
+ properties = { } ;
21
+ _gpfObjectForEach ( serializable , function ( attributes , member ) {
22
+ properties [ member ] = attributes [ 0 ] . getProperty ( ) ;
23
+ } ) ;
24
+ return properties ;
25
+ }
26
+
27
+ /** @gpf :sameas _gpfSerialGet*/
28
+ gpf . serial . get = _gpfSerialGet ;
You can’t perform that action at this time.
0 commit comments