@isz/content-type-is
v0.0.1
Published
🐾 What kind of content is this request/response?
Maintainers
Readme
@isz/content-type-is 
Check the content type of a request or response in a simple way.
import { contentTypeIs } from "@isz/content-type-is";
// …
const its = contentTypeIs(response);
if (its.html) {
// Handle HTML response
} else if (its.json) {
// Handle JSON response
} else {
// Handle other response types
}Supported getters
- html
- json
- plain
- image
- xml
- javascript
- css
- stream
- video
- audio
- binary
- form
- multipart
