UNPKG

@middy/http-json-body-parser

Version:

Http JSON body parser middleware for the middy framework

20 lines (15 loc) 480 B
import type middy from "@middy/core"; import type { ALBEvent, APIGatewayEvent, APIGatewayProxyEventV2, } from "aws-lambda"; interface Options { reviver?: (key: string, value: any) => any; disableContentTypeError?: boolean; } export type RequestEvent = APIGatewayEvent | APIGatewayProxyEventV2 | ALBEvent; declare function jsonBodyParser<EventType extends RequestEvent = RequestEvent>( options?: Options, ): middy.MiddlewareObj<EventType>; export default jsonBodyParser;