File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ import { toEventHandler } from "./handler.ts";
2929export const NoHandler : EventHandler = ( ) => kNotFound ;
3030
3131export class H3Core implements H3CoreType {
32+ static "~h3" = true ;
33+
3234 readonly config : H3CoreConfig ;
3335
3436 "~middleware" : Middleware [ ] ;
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ export function toEventHandler(handler: HTTPHandler | undefined): EventHandler |
167167 if ( typeof handler === "function" ) {
168168 return handler ;
169169 }
170- if ( typeof ( handler as H3Core ) ?. handler === "function" ) {
170+ if ( typeof ( handler as H3Core ) ?. handler === "function" && ( handler as any ) . constructor ?. [ "~h3" ] ) {
171171 return ( handler as H3Core ) . handler ;
172172 }
173173 if ( typeof ( handler as FetchableObject ) ?. fetch === "function" ) {
You can’t perform that action at this time.
0 commit comments