Skip to content
Myr

fix(type): fix order of method overloading (#490)

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

authored by azukiazusa1 · committed by GitHub · parent 28f3b97 · Browse files · 1 file+5 added−5 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+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:src/hono.ts+5 added-5 removed
51 unmodified lines
52 T extends string = string,53 E extends Partial<Environment> = Environment,54 U = Hono<E, T>55> {56 // app.get('/', handler, handler...)56 // app.get(handler...)57 <Path extends string, Env extends Partial<Environment> = E>(58 path: Path,58 ...handlers: Handler<ParamKeys<Path> extends never ? string : ParamKeys<Path>, Env>[]59 ): U61 (path: string, ...handlers: Handler<string, E>[]): U62 // app.get(handler...)60 (...handlers: Handler<string, E>[]): U61 // app.get('/', handler, handler...)62 <Path extends string, Env extends Partial<Environment> = E>(63 path: Path,64 ...handlers: Handler<ParamKeys<Path> extends never ? string : ParamKeys<Path>, Env>[]65 ): U66 (...handlers: Handler<string, E>[]): U66 (path: string, ...handlers: Handler<string, E>[]): U67}6869const methods = ['get', 'post', 'put', 'delete', 'head', 'options', 'patch'] as const70type Methods = typeof methods[number] | typeof METHOD_NAME_ALL_LOWERCASE
171 unmodified lines