Skip to content
Myr

perf(type): improve Utilities in `types.ts` (#3836)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by GitHub · parent 502709f · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/types.ts+2 added-2 removed
1982 unmodified lines
1983export type ExtractSchema<T> = UnionToIntersection<1984 T extends HonoBase<infer _, infer S, any> ? S : never1985>19861987type EnvOrEmpty<T> = T extends Env ? (Env extends T ? {} : T) : T1987type ProcessHead<T> = IfAnyThenEmptyObject<T extends Env ? (Env extends T ? {} : T) : T>1988export type IntersectNonAnyTypes<T extends any[]> = T extends [infer Head, ...infer Rest]1989 ? IfAnyThenEmptyObject<EnvOrEmpty<Head>> & IntersectNonAnyTypes<Rest>1989 ? ProcessHead<Head> & IntersectNonAnyTypes<Rest>1990 : {}19911992////////////////////////////////////////1993////// //////
10 unmodified lines