UNPKG

@middy/http-json-body-parser

Version:

Http JSON body parser middleware for the middy framework

14 lines (9 loc) 458 B
import middy from '@middy/core' import { APIGatewayEvent, APIGatewayProxyEventV2, ALBEvent } 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