0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 10:51:01 +00:00
hono/deno_dist/helper/factory/index.ts
Yusuke Wada bb386a49c9
fix(types): middleware with different env types (#1466)
* fix(types): middleware with different env types

* denoify

* fix factory helper
2023-09-16 20:32:54 +09:00

12 lines
384 B
TypeScript

import type { Env, Input, MiddlewareHandler } from '../../types.ts'
/**
* @experimental
* `middleware()` is an experimental feature.
* The API might be changed.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const middleware = <E extends Env = any, P extends string = any, I extends Input = {}>(
middleware: MiddlewareHandler<E, P, I>
) => middleware