Skip to content

Commit

Permalink
feat(node:events): allow overriding EventEmitter with globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 8, 2023
1 parent 1337f98 commit 5ba2d03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/node/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type nodeEvents from "node:events";
import { EventEmitter as _EventEmitter, once as _once } from "./_events";

export const EventEmitter: typeof nodeEvents.EventEmitter =
_EventEmitter as any as typeof nodeEvents.EventEmitter;
(globalThis as any).EventEmitter || _EventEmitter;

export const once: typeof nodeEvents.once =
_once as any as typeof nodeEvents.once;
Expand Down

0 comments on commit 5ba2d03

Please sign in to comment.