mirror of
https://github.com/honojs/hono.git
synced 2024-11-29 01:32:12 +01:00
fix(context): remove duplicate definition of render method (#2191)
* fix(context): remove duplicate definition of render method The `render` method was defined twice in the `Context` class. This duplicate definition was causing a TypeScript error below if `tsc` is used to compile the project: ``` node_modules/hono/dist/types/context.d.ts(134,5): error TS2300: Duplicate identifier 'render'. ``` * chore: denoify
This commit is contained in:
parent
ca6f365110
commit
c62556ae06
@ -209,10 +209,10 @@ export class Context<
|
||||
* ```
|
||||
* @see https://hono.dev/api/context#render-setrenderer
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
render: Renderer = (...args: any[]) => this.renderer(...args)
|
||||
render: Renderer = (...args) => this.renderer(...args)
|
||||
|
||||
setLayout = (layout: FC<PropsForRenderer & { Layout: FC }>) => (this.layout = layout)
|
||||
getLayout = () => this.layout
|
||||
|
||||
/**
|
||||
* `.setRenderer()` can set the layout in the custom middleware.
|
||||
@ -233,13 +233,6 @@ export class Context<
|
||||
* ```
|
||||
* @see https://hono.dev/api/context#render-setrenderer
|
||||
*/
|
||||
// @ts-expect-error It is unknown how many arguments the renderer will receive.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
render: Renderer = (...args: any[]) => this.renderer(...args)
|
||||
|
||||
setLayout = (layout: FC<PropsForRenderer & { Layout: FC }>) => (this.layout = layout)
|
||||
getLayout = () => this.layout
|
||||
|
||||
setRenderer = (renderer: Renderer) => {
|
||||
this.renderer = renderer
|
||||
}
|
||||
|
@ -209,10 +209,10 @@ export class Context<
|
||||
* ```
|
||||
* @see https://hono.dev/api/context#render-setrenderer
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
render: Renderer = (...args: any[]) => this.renderer(...args)
|
||||
render: Renderer = (...args) => this.renderer(...args)
|
||||
|
||||
setLayout = (layout: FC<PropsForRenderer & { Layout: FC }>) => (this.layout = layout)
|
||||
getLayout = () => this.layout
|
||||
|
||||
/**
|
||||
* `.setRenderer()` can set the layout in the custom middleware.
|
||||
@ -233,13 +233,6 @@ export class Context<
|
||||
* ```
|
||||
* @see https://hono.dev/api/context#render-setrenderer
|
||||
*/
|
||||
// @ts-expect-error It is unknown how many arguments the renderer will receive.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
render: Renderer = (...args: any[]) => this.renderer(...args)
|
||||
|
||||
setLayout = (layout: FC<PropsForRenderer & { Layout: FC }>) => (this.layout = layout)
|
||||
getLayout = () => this.layout
|
||||
|
||||
setRenderer = (renderer: Renderer) => {
|
||||
this.renderer = renderer
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user