diff options
| author | Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> | 2024-05-29 07:12:50 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-29 07:12:50 +0900 |
| commit | cf670e8a3dc9830110312b54eceaea29cf20495c (patch) | |
| tree | 0eda34628ca78d3df3d21bd7628c4f9ec1325f01 /packages/backend/src/core | |
| parent | chore(backend): rename local variable (#13904) (diff) | |
| download | sharkey-cf670e8a3dc9830110312b54eceaea29cf20495c.tar.gz sharkey-cf670e8a3dc9830110312b54eceaea29cf20495c.tar.bz2 sharkey-cf670e8a3dc9830110312b54eceaea29cf20495c.zip | |
refactor(backend): avoid `as any` on CustomEmojiService.ts (#13903)
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/CustomEmojiService.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index 1c75566755..b1feca7fb4 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -346,10 +346,11 @@ export class CustomEmojiService implements OnApplicationShutdown { @bindThis public async populateEmojis(emojiNames: string[], noteUserHost: string | null): Promise<Record<string, string>> { const emojis = await Promise.all(emojiNames.map(x => this.populateEmoji(x, noteUserHost))); - const res = {} as any; + const res = {} as Record<string, string>; for (let i = 0; i < emojiNames.length; i++) { - if (emojis[i] != null) { - res[emojiNames[i]] = emojis[i]; + const resolvedEmoji = emojis[i]; + if (resolvedEmoji != null) { + res[emojiNames[i]] = resolvedEmoji; } } return res; |