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'
1212import { JikePost , JikePostWithDetail } from './post'
1313import type { CreatePostOption } from '../types/options'
1414import 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'
1621import type { BeforeRetryState } from 'ky/distribution/types/hooks'
1722import type { PaginatedFetcher , PaginatedOption } from './utils/paginate'
1823import type { Api } from '../api'
@@ -237,14 +242,18 @@ export class JikeClient extends EventEmitter<EventMap> {
237242 } ) ,
238243 option
239244 )
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+ }
246255 }
247- } )
256+ )
248257 }
249258
250259 /**
Original file line number Diff line number Diff line change @@ -169,12 +169,14 @@ export class JikePost {
169169}
170170
171171export class JikePostWithDetail extends JikePost {
172+ detail : Post
173+
172174 constructor ( client : JikeClient , type : PostType , id : string , detail : Post ) {
173175 super ( client , type , id , detail )
174176 this . detail = detail
175177 }
176178
177179 getDetail ( ) : Post {
178- return this . detail !
180+ return this . detail
179181 }
180182}
You can’t perform that action at this time.
0 commit comments