Skip to main content
Module

x/type_is/mod.ts>is

Infer the content-type of a HTTP Header for Deno
Latest
function is
import { is } from "https://deno.land/x/type_is@1.0.3/mod.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