summaryrefslogtreecommitdiff
path: root/packages/backend
diff options
context:
space:
mode:
authorKisaragi <48310258+KisaragiEffective@users.noreply.github.com>2024-05-29 07:12:50 +0900
committerGitHub <noreply@github.com>2024-05-29 07:12:50 +0900
commitcf670e8a3dc9830110312b54eceaea29cf20495c (patch)
tree0eda34628ca78d3df3d21bd7628c4f9ec1325f01 /packages/backend
parentchore(backend): rename local variable (#13904) (diff)
downloadsharkey-cf670e8a3dc9830110312b54eceaea29cf20495c.tar.gz
sharkey-cf670e8a3dc9830110312b54eceaea29cf20495c.tar.bz2
sharkey-cf670e8a3dc9830110312b54eceaea29cf20495c.zip
refactor(backend): avoid `as any` on CustomEmojiService.ts (#13903)
Diffstat (limited to 'packages/backend')
-rw-r--r--packages/backend/src/core/CustomEmojiService.ts7
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;