Skip to content

Commit f4a1a34

Browse files
committed
chore: remove useless async keyword
1 parent 772cbeb commit f4a1a34

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

src/api/media-meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { InteractiveResponse } from '../types/api-responses'
88
* @param type 类型 如:STORY
99
* @param trigger 触发 如:user
1010
*/
11-
export const interactive = async <T = InteractiveResponse>(
11+
export const interactive = <T = InteractiveResponse>(
1212
id: string,
1313
type: LiteralUnion<'STORY'>,
1414
trigger: LiteralUnion<'user'> = 'user'

src/api/personal-update.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { PersonalUpdate } from '../types/api-responses'
88
* @param username 用户名
99
* @param option 选项
1010
*/
11-
export const single = async <T = PersonalUpdate.SingleResponse>(
11+
export const single = <T = PersonalUpdate.SingleResponse>(
1212
username: string,
1313
option: PaginationOption<{ lastId: string }> = {}
1414
) =>
@@ -26,9 +26,7 @@ export const single = async <T = PersonalUpdate.SingleResponse>(
2626
* 获取关注动态
2727
* @param option 分页选项
2828
*/
29-
export const followingUpdates = async <
30-
T = PersonalUpdate.FollowingUpdatesResponse
31-
>(
29+
export const followingUpdates = <T = PersonalUpdate.FollowingUpdatesResponse>(
3230
option: PaginationOption<{
3331
session: 'PopulatedUpdate'
3432
lastReadTime: number
@@ -47,7 +45,7 @@ export const followingUpdates = async <
4745
/**
4846
* 置顶动态
4947
*/
50-
export const pin = async <T = PersonalUpdate.PinResponse>(
48+
export const pin = <T = PersonalUpdate.PinResponse>(
5149
type: PostTypeRaw,
5250
id: string
5351
) =>
@@ -63,7 +61,7 @@ export const pin = async <T = PersonalUpdate.PinResponse>(
6361
/**
6462
* 取消置顶动态
6563
*/
66-
export const unpin = async <T = PersonalUpdate.UnpinResponse>(
64+
export const unpin = <T = PersonalUpdate.UnpinResponse>(
6765
type: PostTypeRaw,
6866
id: string
6967
) =>

src/api/stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import type { Stories } from '../types/api-responses'
44
/**
55
* 获取关注用户日记列表
66
*/
7-
export const followingFeed = async <T = Stories.FollowingFeedResponse>() =>
7+
export const followingFeed = <T = Stories.FollowingFeedResponse>() =>
88
toResponse<T>(request.get('1.0/stories/followingFeed'))
99

1010
/**
1111
* 获取用户的日记详情
1212
* @param username 用户名
1313
*/
14-
export const listUserStories = async <T = Stories.ListUserStoriesResponse>(
14+
export const listUserStories = <T = Stories.ListUserStoriesResponse>(
1515
username: string
1616
) =>
1717
toResponse<T>(

src/api/users.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const profile = <T = Users.MyProfile & Users.UserProfile>(
2020
* 刷新 Access Token
2121
* @param refreshToken 登录时返回的 refresh token
2222
*/
23-
export const refreshToken = async <T = Users.RefreshTokenResponse>(
23+
export const refreshToken = <T = Users.RefreshTokenResponse>(
2424
refreshToken: string
2525
) =>
2626
toResponse<T>(

src/client/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class JikeClient extends EventEmitter<EventMap> {
187187
/**
188188
* 查询通知
189189
*/
190-
async queryNotifications(
190+
queryNotifications(
191191
option: PaginatedOption<
192192
Notification,
193193
'createdAt' | 'updatedAt',

src/client/post.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class JikePost {
100100
* 获取点赞用户列表
101101
* @returns 用户列表
102102
*/
103-
async listLikedUsers(option: PaginatedOption<User, never, string> = {}) {
103+
listLikedUsers(option: PaginatedOption<User, never, string> = {}) {
104104
const fetcher: PaginatedFetcher<User, string> = async (lastKey) => {
105105
const result = await this.apiClient.posts.listLikedUsers(
106106
this.type,
@@ -139,7 +139,7 @@ export class JikePost {
139139
/**
140140
* 查询评论
141141
*/
142-
async queryComments(
142+
queryComments(
143143
order?: ListCommentOption['order'],
144144
option: PaginatedOption<Comment, 'createdAt', ListCommentMoreKey> = {}
145145
) {

tests/api-client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
22
import { ApiClient, getAccessToken } from '../src'
33
import { config } from './config'
44

5-
describe('api client should work', async () => {
5+
describe('api client should work', () => {
66
const client = ApiClient(config)
77

88
it('access token should correct', async () => {

0 commit comments

Comments
 (0)