Skip to content
Myr

chore(type): fixed generics warnings

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

authored by Yusuke Wada · committed by Yusuke Wada · parent d54ff87 · Browse files · 1 file+6 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+6 added−2 removed

  • other:+6 added−2 removed

1 file+6 added−2 removed

modified:src/hono.ts+6 added-2 removed
26 unmodified lines
27type ParamKeys<Path> = Path extends `${infer Component}/${infer Rest}`28 ? ParamKey<Component> | ParamKeys<Rest>29 : ParamKey<Path>3031interface HandlerInterface<T extends string, E = Env, U = Hono<E, T>> {31interface HandlerInterface<T extends string, E extends Env = Env, U = Hono<E, T>> {32 // app.get('/', handler, handler...)33 <Path extends string>(34 path: Path,35 ...handlers: Handler<ParamKeys<Path> extends never ? string : ParamKeys<Path>, E>[]
22 unmodified lines
58 method: string59 handler: Handler<string, E>60}6162export class Hono<E = Env, P extends string = '/'> extends defineDynamicClass()<E, P, Hono<E, P>> {62export class Hono<E extends Env = Env, P extends string = '/'> extends defineDynamicClass()<63 E,64 P,65 Hono<E, P>66> {67 readonly router: Router<Handler<string, E>> = new TrieRouter()68 readonly strict: boolean = true // strict routing - default is true69 private _tempPath: string = ''70 private path: string = '/'
137 unmodified lines