From 85a3ecf864f9a386a8237ac7c95340aca83c6a57 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Sat, 18 Jan 2025 19:16:01 +0900 Subject: [PATCH] perf(type): improve Utilities in `types.ts` --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index bfa96a260..68f3a9859 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1984,9 +1984,9 @@ export type ExtractSchema = UnionToIntersection< T extends HonoBase ? S : never > -type EnvOrEmpty = T extends Env ? (Env extends T ? {} : T) : T +type ProcessHead = IfAnyThenEmptyObject export type IntersectNonAnyTypes = T extends [infer Head, ...infer Rest] - ? IfAnyThenEmptyObject> & IntersectNonAnyTypes + ? ProcessHead & IntersectNonAnyTypes : {} ////////////////////////////////////////