fix type in CustomEmojiService

This commit is contained in:
tamaina 2023-04-12 12:09:28 +00:00
parent b7d056fb22
commit 6ea057f8f8
1 changed files with 2 additions and 2 deletions

View File

@ -46,9 +46,9 @@ export class CustomEmojiService {
toRedisConverter: (value) => JSON.stringify(Array.from(value.values())),
fromRedisConverter: (value) => {
if (!Array.isArray(JSON.parse(value))) return undefined; // 古いバージョンの壊れたキャッシュが残っていることがある(そのうち消す)
return new Map(JSON.parse(value).map((x) => [x.name, {
return new Map(JSON.parse(value).map((x: Emoji) => [x.name, {
...x,
updatedAt: new Date(x.updatedAt),
updatedAt: x.updatedAt && new Date(x.updatedAt),
}]));
},
});