@@ -22,17 +22,17 @@ class KubernetesObject {
22
22
{
23
23
name : 'apiVersion' ,
24
24
baseName : 'apiVersion' ,
25
- type : 'string'
25
+ type : 'string' ,
26
26
} ,
27
27
{
28
28
name : 'kind' ,
29
29
baseName : 'kind' ,
30
- type : 'string'
30
+ type : 'string' ,
31
31
} ,
32
32
{
33
33
name : 'metadata' ,
34
34
baseName : 'metadata' ,
35
- type : 'V1ObjectMeta'
35
+ type : 'V1ObjectMeta' ,
36
36
} ,
37
37
] ;
38
38
}
@@ -44,7 +44,6 @@ const isKubernetesObject = (data: unknown): boolean =>
44
44
* Wraps the ObjectSerializer to support custom resources and generic Kubernetes objects.
45
45
*/
46
46
class KubernetesObjectSerializer {
47
-
48
47
private static _instance : KubernetesObjectSerializer ;
49
48
50
49
public static get instance ( ) : KubernetesObjectSerializer {
@@ -59,7 +58,7 @@ class KubernetesObjectSerializer {
59
58
60
59
public serialize ( data : any , type : string ) : any {
61
60
const obj = ObjectSerializer . serialize ( data , type ) ;
62
- if ( obj !== data ) {
61
+ if ( obj !== data ) {
63
62
return obj ;
64
63
}
65
64
@@ -69,7 +68,10 @@ class KubernetesObjectSerializer {
69
68
70
69
const instance : Record < string , any > = { } ;
71
70
for ( const attributeType of KubernetesObject . attributeTypeMap ) {
72
- instance [ attributeType . name ] = ObjectSerializer . serialize ( data [ attributeType . baseName ] , attributeType . type ) ;
71
+ instance [ attributeType . name ] = ObjectSerializer . serialize (
72
+ data [ attributeType . baseName ] ,
73
+ attributeType . type ,
74
+ ) ;
73
75
}
74
76
// add all unknown properties as is.
75
77
for ( const [ key , value ] of Object . entries ( data ) ) {
@@ -79,7 +81,6 @@ class KubernetesObjectSerializer {
79
81
instance [ key ] = value ;
80
82
}
81
83
return instance ;
82
-
83
84
}
84
85
85
86
public deserialize ( data : any , type : string ) : any {
@@ -95,7 +96,10 @@ class KubernetesObjectSerializer {
95
96
96
97
const instance = new KubernetesObject ( ) ;
97
98
for ( const attributeType of KubernetesObject . attributeTypeMap ) {
98
- instance [ attributeType . name ] = ObjectSerializer . deserialize ( data [ attributeType . baseName ] , attributeType . type ) ;
99
+ instance [ attributeType . name ] = ObjectSerializer . deserialize (
100
+ data [ attributeType . baseName ] ,
101
+ attributeType . type ,
102
+ ) ;
99
103
}
100
104
// add all unknown properties as is.
101
105
for ( const [ key , value ] of Object . entries ( data ) ) {
0 commit comments