Skip to content

Commit

Permalink
Rename hook property ogImage to image for better semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
neg4n committed Jul 8, 2022
1 parent e3fe187 commit 968565b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type StrategyAwareParams<
: Record<StrategyDetails extends string ? StrategyDetails : string, NonNullable<string>>

type NextApiRequestWithOgImage = {
ogImage: string | Buffer
image: string | Buffer
}

export type NextApiOgImageConfig<
Expand All @@ -43,8 +43,8 @@ export type NextApiOgImageConfig<
width?: number
height?: number
type?: ImageType
hook?: (request: NextApiRequestWithOgImage) => void | Promise<void>,
quality?: number
hook?: (request: NextApiRequestWithOgImage) => void | Promise<void>,
dev?: Partial<{
inspectHtml: boolean
errorsInResponse: boolean
Expand Down Expand Up @@ -124,7 +124,7 @@ export function withOGImage<
if (!!hook) {
const extendedRequest: NextApiRequestWithOgImage = {
...request,
ogImage: image
image
}

await hook(extendedRequest)
Expand Down

0 comments on commit 968565b

Please sign in to comment.