From 968565b09753762b50ec66d8ec1984232a241f85 Mon Sep 17 00:00:00 2001 From: Igor Klepacki Date: Fri, 8 Jul 2022 08:49:09 +0200 Subject: [PATCH] Rename hook property ogImage to image for better semantics --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4701314..e7d79e5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,7 +24,7 @@ type StrategyAwareParams< : Record> type NextApiRequestWithOgImage = { - ogImage: string | Buffer + image: string | Buffer } export type NextApiOgImageConfig< @@ -43,8 +43,8 @@ export type NextApiOgImageConfig< width?: number height?: number type?: ImageType - hook?: (request: NextApiRequestWithOgImage) => void | Promise, quality?: number + hook?: (request: NextApiRequestWithOgImage) => void | Promise, dev?: Partial<{ inspectHtml: boolean errorsInResponse: boolean @@ -124,7 +124,7 @@ export function withOGImage< if (!!hook) { const extendedRequest: NextApiRequestWithOgImage = { ...request, - ogImage: image + image } await hook(extendedRequest)