Skip to content

Commit 5a984da

Browse files
committed
fix(isEvent): safer check for bun compatibility
1 parent eaeb1e1 commit 5a984da

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/utils/event.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import type { H3EventContext } from "../types/context.ts";
88
* @see H3Event
99
*/
1010
export function isEvent(input: any): input is H3Event {
11-
const ctor = input?.constructor;
12-
return (
13-
ctor.__is_event__ ||
14-
input.__is_event__ /* Backward compatibility with h3 v1 */
15-
);
11+
return input instanceof H3Event || input?.constructor?.__is_event__;
1612
}
1713

1814
export function mockEvent(

0 commit comments

Comments
 (0)