Compressible Content-Type / mime checking. Forked for TypeScript and keep mime-db as same version as mime-types
npm install @eggjs/compressible[![NPM version][npm-image]][npm-url]

[![Test coverage][codecov-image]][codecov-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]


!CodeRabbit Pull Request Reviews
[npm-image]: https://img.shields.io/npm/v/@eggjs/compressible.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@eggjs/compressible
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/compressible.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/compressible?branch=master
[snyk-image]: https://snyk.io/test/npm/@eggjs/compressible/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/@eggjs/compressible
[download-image]: https://img.shields.io/npm/dm/@eggjs/compressible.svg?style=flat-square
[download-url]: https://npmjs.org/package/@eggjs/compressible
Compressible Content-Type / mime checking.
Forked compressible for TypeScript and keep mime-db as same version as mime-types.
``sh`
npm install @eggjs/compressible
`ts`
import { compressible } from '@eggjs/compressible';
Checks if the given Content-Type is compressible. The type argument is expectedContent-Type
to be a value MIME type or string, though no validation is performed.
The MIME is looked up in the mime-db and
if there is compressible information in the database entry, that is returned. Otherwise,
this module will fallback to true for the following types:
text//*+json
/*+text
/*+xml
If this module is not sure if a type is specifically compressible or specifically
uncompressible, undefined is returned.
`ts``
compressible('text/html') // => true
compressible('image/png') // => false

Made with contributors-img.