Skip to main content
Module

x/acorn/mod.ts>Deserializer

A focused RESTful server framework for Deno 🌰🦕
Go to Latest
interface Deserializer
import { type Deserializer } from "https://deno.land/x/acorn@0.4.0/mod.ts";

The interface to allow handling of request bodies in a structured way.

Type Parameters

Type
Params extends Record<string, string>

Methods

parse(
value: string,
params: Params,
request: Request,
): Promise<Type> | Type

Given the request body as a string along with any parameters parsed when matching the route and the original Request return a value to represent the body which will be provided to the route handler.

This is intended to allow validation and hydration of objects to be provided to route handlers.