mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-30 09:55:18 +00:00
refactor(shim): Move node CustomEvent polyfill to Platform.shim (#357)
This commit is contained in:
13
src/platform/polyfills/node-custom-event.ts
Normal file
13
src/platform/polyfills/node-custom-event.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// See https://github.com/nodejs/node/issues/40678#issuecomment-1126944677
|
||||
export default class CustomEvent extends Event {
|
||||
#detail;
|
||||
|
||||
constructor(type: string, options?: CustomEventInit<any[]>) {
|
||||
super(type, options);
|
||||
this.#detail = options?.detail ?? null;
|
||||
}
|
||||
|
||||
get detail() {
|
||||
return this.#detail;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user