Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/doa/utils/typeIs.ts>is

A middleware framework for Deno's http serve🦕. Transplanted from Koa with ❤️
Latest
function is
import { is } from "https://deno.land/x/doa@v1.0.0/utils/typeIs.ts";

Compare a value content-type with types. Each type can be an extension like html, a special shortcut like multipart or urlencoded, or a mime type.

If no types match, false is returned. Otherwise, the first type that matches is returned.

Parameters

mediaType: string
optional
types: string[]

Returns

boolean | string