e81c2962a0
* chore: Make image/avif browsersafe * server side * change FileInfoService * ✌️ * avifはMastodonでは絶望的 see https://github.com/misskey-dev/misskey/issues/9283 Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
8 lines
388 B
TypeScript
8 lines
388 B
TypeScript
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
|
|
|
|
const dictionary = {
|
|
'safe-file': FILE_TYPE_BROWSERSAFE,
|
|
'sharp-convertible-image': ['image/jpeg', 'image/png', 'image/gif', 'image/apng', 'image/vnd.mozilla.apng', 'image/webp', 'image/avif', 'image/svg+xml'],
|
|
};
|
|
|
|
export const isMimeImage = (mime: string, type: keyof typeof dictionary): boolean => dictionary[type].includes(mime);
|