/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/vips/src/utils.ts
43 строки
1 KB
Pascal Birchler
Add new private `vips` package (#64845)
21 окт 2024, 15:41
Не верифицирован
21 окт 2024, 15:41
5d7ecbe
Код
Авторство
О чём код?
/** * Determines whether a given file type supports a quality setting, * * @todo Make this smarter. * * @param type Mime type. * @return Whether the file supports a quality setting. */ export function supportsQuality( type: string ): type is 'image/jpeg' | 'image/png' | 'image/webp' | 'image/avif' { return [ 'image/jpeg', 'image/png', 'image/webp', 'image/avif' ].includes( type ); } /** * Determines whether a given file type supports animation, * * @todo Make this smarter. * * @param type Mime type. * @return Whether the file supports animation. */ export function supportsAnimation( type: string ): type is 'image/webp' | 'image/gif' { return [ 'image/webp', 'image/gif' ].includes( type ); } /** * Determines whether a given file type supports interlaced/progressive output. * * @todo Make this smarter. * * @param type Mime type. * @return Whether the file supports interlaced/progressive output. */ export function supportsInterlace( type: string ): type is 'image/jpeg' | 'image/gif' | 'image/png' { return [ 'image/jpeg', 'image/gif', 'image/png' ].includes( type ); }