File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -129,25 +129,29 @@ class Character {
129129}
130130
131131class Human extends Character {
132- __typename : string ;
133132 homePlanet : string ;
134133
135134 constructor ( data : HumanData ) {
136135 super ( data ) ;
137- this . __typename = 'Human' ;
138136 this . homePlanet = data . homePlanet ;
139137 }
138+
139+ get __typename ( ) : string {
140+ return 'Human' ;
141+ }
140142}
141143
142144class Droid extends Character {
143- __typename : string ;
144145 primaryFunction : string ;
145146
146147 constructor ( data : DroidData ) {
147148 super ( data ) ;
148- this . __typename = 'Droid' ;
149149 this . primaryFunction = data . primaryFunction ;
150150 }
151+
152+ get __typename ( ) : string {
153+ return 'Droid' ;
154+ }
151155}
152156
153157function makeCharacterObj ( data : CharacterData ) {
You can’t perform that action at this time.
0 commit comments