refactor(backend): avoid as any on CustomEmojiService.ts (#13903)

This commit is contained in:
Kisaragi 2024-05-29 07:12:50 +09:00 committed by GitHub
parent e57ce4fa0f
commit cf670e8a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;