@@ -10,7 +10,7 @@ import {TypeAnswer} from '../result-types/TypeAnswer';
1010 */
1111export class Answer {
1212
13- public accepted ? : boolean ;
13+ public accepted : boolean ;
1414
1515 /**
1616 * Refers to an [[Answer]]
@@ -20,36 +20,36 @@ export class Answer {
2020 /**
2121 * *May be absent, in which case it is set to `null`*
2222 */
23- public awardedBountyAmount ? : number ;
23+ public awardedBountyAmount : number ;
2424
2525 /**
2626 * *May be absent, in which case it is set to `null`*
2727 */
28- public awardedBountyUsers ? : ShallowUser [ ] ;
28+ public awardedBountyUsers : ShallowUser [ ] ;
2929
30- public body ? : string ;
30+ public body : string ;
3131
32- public bodyMarkdown ? : string ;
32+ public bodyMarkdown : string ;
3333
34- public canFlag ? : boolean ;
34+ public canFlag : boolean ;
3535
36- public commentCount ? : number ;
36+ public commentCount : number ;
3737
3838 /**
3939 * *May be absent, in which case it is set to `null`*
4040 */
41- public comments ? : Comment [ ] ;
41+ public comments : Comment [ ] ;
4242
4343 /**
4444 * *May be absent, in which case it is set to `null`*
4545 */
46- public communityOwnedDate ? : Date ;
46+ public communityOwnedDate : Date ;
4747
4848 public creationDate : Date ;
4949
50- public downVoteCount ? : number ;
50+ public downVoteCount : number ;
5151
52- public downvoted ? : boolean ;
52+ public downvoted : boolean ;
5353
5454 public isAccepted : boolean ;
5555
@@ -58,21 +58,21 @@ export class Answer {
5858 /**
5959 * *May be absent, in which case it is set to `null`*
6060 */
61- public lastEditDate ? : Date ;
61+ public lastEditDate : Date ;
6262
63- public lastEditor ? : ShallowUser ;
63+ public lastEditor : ShallowUser ;
6464
65- public link ? : string ;
65+ public link : string ;
6666
6767 /**
6868 * *May be absent, in which case it is set to `null`*
6969 */
70- public lockedDate ? : Date ;
70+ public lockedDate : Date ;
7171
7272 /**
7373 * *May be absent, in which case it is set to `null`*
7474 */
75- public owner ? : ShallowUser ;
75+ public owner : ShallowUser ;
7676
7777 /**
7878 * Refers to a [[Question]]
@@ -81,19 +81,19 @@ export class Answer {
8181
8282 public score : number ;
8383
84- public shareLink ? : string ;
84+ public shareLink : string ;
8585
86- public tags ? : string [ ] ;
86+ public tags : string [ ] ;
8787
88- public title ? : string ;
88+ public title : string ;
8989
90- public upVoteCount ? : number ;
90+ public upVoteCount : number ;
9191
92- public upvoted ? : boolean ;
92+ public upvoted : boolean ;
9393
9494 public constructor ( answer : TypeAnswer ) {
9595 this . accepted = answer . accepted ?? null ;
96- this . answerId = answer . answer_id ;
96+ this . answerId = answer . answer_id ?? null ;
9797 this . awardedBountyAmount = answer . awarded_bounty_amount ?? null ;
9898 if ( typeof answer . awarded_bounty_users === 'undefined' ) {
9999 this . awardedBountyUsers = null ;
@@ -112,11 +112,11 @@ export class Answer {
112112 . map ( ( comment ) => new Comment ( comment ) ) ;
113113 }
114114 this . communityOwnedDate = answer . community_owned_date ?? null ;
115- this . creationDate = answer . creation_date ;
115+ this . creationDate = answer . creation_date ?? null ;
116116 this . downVoteCount = answer . down_vote_count ?? null ;
117117 this . downvoted = answer . downvoted ?? null ;
118- this . isAccepted = answer . is_accepted ;
119- this . lastActivityDate = answer . last_activity_date ;
118+ this . isAccepted = answer . is_accepted ?? null ;
119+ this . lastActivityDate = answer . last_activity_date ?? null ;
120120 this . lastEditDate = answer . last_edit_date ?? null ;
121121 if ( typeof answer . last_editor === 'undefined' ) {
122122 this . lastEditor = null ;
@@ -130,8 +130,8 @@ export class Answer {
130130 } else {
131131 this . owner = new ShallowUser ( answer . owner ) ;
132132 }
133- this . questionId = answer . question_id ;
134- this . score = answer . score ;
133+ this . questionId = answer . question_id ?? null ;
134+ this . score = answer . score ?? null ;
135135 this . shareLink = answer . share_link ?? null ;
136136 this . tags = answer . tags ?? null ;
137137 this . title = answer . title ?? null ;
0 commit comments