Created
January 18, 2025 09:45
-
-
Save yusukebe/23d5f6b35fb75d607e2b26c715fdeb40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/types.ts b/src/types.ts | |
index 193f73ad..4225be41 100644 | |
--- a/src/types.ts | |
+++ b/src/types.ts | |
@@ -1984,9 +1984,9 @@ export type ExtractSchema<T> = UnionToIntersection< | |
T extends HonoBase<infer _, infer S, any> ? S : never | |
> | |
-type EnvOrEmpty<T> = T extends Env ? (Env extends T ? {} : T) : T | |
+type ProcessHead<T> = IfAnyThenEmptyObject<T extends Env ? (Env extends T ? {} : T) : T> | |
export type IntersectNonAnyTypes<T extends any[]> = T extends [infer Head, ...infer Rest] | |
- ? IfAnyThenEmptyObject<EnvOrEmpty<Head>> & IntersectNonAnyTypes<Rest> | |
+ ? ProcessHead<Head> & IntersectNonAnyTypes<Rest> | |
: {} | |
//////////////////////////////////////// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment