diff --git a/lib/index.ts b/lib/index.ts index c1b4b45..f9f8aaf 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -46,9 +46,11 @@ export const dictionary = { "aws:websocket": apiGatewayTemplate as APIGatewayEvent, // Websockets are included in APIG typedef: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32855/files }; +// https://typeofnan.dev/creating-your-own-deeppartial-type-in-typescript/ +type DeepPartial = Partial<{ [P in keyof T]: DeepPartial }>; export default function createEvent( eventType: T, - body: typeof dictionary[T], + body: DeepPartial, ): typeof dictionary[T] { const event = dictionary[eventType]; let generatedEvent = {};