refactor(shim): Move node CustomEvent polyfill to Platform.shim (#357)

This commit is contained in:
absidue
2023-03-15 04:49:33 +01:00
committed by GitHub
parent 9b005d62d6
commit ffd7d79308
6 changed files with 25 additions and 25 deletions

View File

@@ -17,6 +17,7 @@ import os from 'os';
import fs from 'fs/promises';
import { readFileSync } from 'fs';
import DOMParser from './polyfills/server-dom.js';
import CustomEvent from './polyfills/node-custom-event.js';
import { fileURLToPath } from 'url';
import evaluate from './jsruntime/jinter.js';
@@ -123,7 +124,8 @@ Platform.load({
Headers: Headers as unknown as typeof globalThis.Headers,
FormData: FormData as unknown as typeof globalThis.FormData,
File: File as unknown as typeof globalThis.File,
ReadableStream: ReadableStream as unknown as typeof globalThis.ReadableStream
ReadableStream: ReadableStream as unknown as typeof globalThis.ReadableStream,
CustomEvent: CustomEvent as unknown as typeof globalThis.CustomEvent
});
export * from './lib.js';