From a2c3747e41fed5b6e166a5a617c4ca428a04b280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Charles?= Date: Wed, 9 Oct 2024 14:34:58 +0200 Subject: [PATCH] fix: typings --- examples/tool/package.json | 2 +- packages/universal-middleware/src/plugin.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/tool/package.json b/examples/tool/package.json index 20521fa..491ce53 100644 --- a/examples/tool/package.json +++ b/examples/tool/package.json @@ -307,4 +307,4 @@ "@universal-middleware/elysia": "^0" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/universal-middleware/src/plugin.ts b/packages/universal-middleware/src/plugin.ts index 34da13b..ad7521e 100644 --- a/packages/universal-middleware/src/plugin.ts +++ b/packages/universal-middleware/src/plugin.ts @@ -247,8 +247,8 @@ type ExtractT = T extends (...args: infer X) => any ? X : never; type ExtractInContext = T extends (...args: any[]) => UniversalMiddleware ? unknown extends X ? Universal.Context : X : {}; export type InContext = ExtractInContext; export type OutContext = ${info.outContext?.(type) ?? "unknown"}; -export type Args = ExtractT; -export type Middleware = ReturnType>>; +export type Args = ExtractT; +export type Middleware = ReturnType>>; export default ${fn}(${type}) as (...args: Args) => Middleware; `;