refactor(backend): avoid `as any` on CustomEmojiService.ts (#13903)
This commit is contained in:
parent
e57ce4fa0f
commit
cf670e8a3d
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue