File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ import { AuthorizationError } from './errors/AuthorizationError'
12
12
import { JikePost , JikePostWithDetail } from './post'
13
13
import type { CreatePostOption } from '../types/options'
14
14
import type { FollowingUpdatesMoreKey , JikeClientJSON } from './types'
15
- import type { FollowingUpdate , Notification , Post } from '../types/entity'
15
+ import type {
16
+ FollowingUpdate ,
17
+ Notification ,
18
+ PersonalUpdate ,
19
+ Post ,
20
+ } from '../types/entity'
16
21
import type { BeforeRetryState } from 'ky/distribution/types/hooks'
17
22
import type { PaginatedFetcher , PaginatedOption } from './utils/paginate'
18
23
import type { Api } from '../api'
@@ -237,14 +242,18 @@ export class JikeClient extends EventEmitter<EventMap> {
237
242
} ) ,
238
243
option
239
244
)
240
- return updates . map ( ( update ) => {
241
- // TODO repost
242
- if ( update . type === 'ORIGINAL_POST' ) {
243
- return this . getPost ( PostType . ORIGINAL , update . id , update )
244
- } else {
245
- return update
245
+ return updates . map (
246
+ (
247
+ update
248
+ ) : ( { actionTime : string } & PersonalUpdate ) | JikePostWithDetail => {
249
+ // TODO repost
250
+ if ( update . type === 'ORIGINAL_POST' ) {
251
+ return this . getPost ( PostType . ORIGINAL , update . id , update )
252
+ } else {
253
+ return update
254
+ }
246
255
}
247
- } )
256
+ )
248
257
}
249
258
250
259
/**
Original file line number Diff line number Diff line change @@ -169,12 +169,14 @@ export class JikePost {
169
169
}
170
170
171
171
export class JikePostWithDetail extends JikePost {
172
+ detail : Post
173
+
172
174
constructor ( client : JikeClient , type : PostType , id : string , detail : Post ) {
173
175
super ( client , type , id , detail )
174
176
this . detail = detail
175
177
}
176
178
177
179
getDetail ( ) : Post {
178
- return this . detail !
180
+ return this . detail
179
181
}
180
182
}
You can’t perform that action at this time.
0 commit comments