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

x/doa/utils/typeIs.ts>normalize

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

Normalize a mime type. If it's a shorthand, expand it to a valid mime type.

In general, you probably want:

const type = is(req, ['urlencoded', 'json', 'multipart']);

Then use the appropriate body parsers. These three are the most common request body types and are thus ensured to work.

type

(type: string) => string | undefined