1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-27 14:28:59 +09:00

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 @bindThis
public async populateEmojis(emojiNames: string[], noteUserHost: string | null): Promise<Record<string, string>> { 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 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++) { for (let i = 0; i < emojiNames.length; i++) {
if (emojis[i] != null) { const resolvedEmoji = emojis[i];
res[emojiNames[i]] = emojis[i]; if (resolvedEmoji != null) {
res[emojiNames[i]] = resolvedEmoji;
} }
} }
return res; return res;