( post: T, )
| 143 | * it shares the post it wraps, the same way the API resolves it. |
| 144 | */ |
| 145 | export const getPostToShare = < |
| 146 | T extends Pick<Post, 'type' | 'title' | 'sharedPost'>, |
| 147 | >( |
| 148 | post: T, |
| 149 | ): T | SharedPost => |
| 150 | post.type === PostType.Share && !post.title && post.sharedPost |
| 151 | ? post.sharedPost |
| 152 | : post; |
| 153 | |
| 154 | export const getPostTitle = ( |
| 155 | post: |
no outgoing calls
no test coverage detected