1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-25 09:49:36 +01:00
deka-dom-el/src/jsdom.js

12 lines
363 B
JavaScript
Raw Normal View History

2023-09-05 11:01:29 +02:00
let keys= [];
export function register(dom){
const window= dom.window;
if(!keys.length)
keys= Object.getOwnPropertyNames(window).filter((k) => !k.startsWith('_') && !(k in globalThis));
keys.forEach(key=> globalThis[key]= window[key]);
global.document= window.document
global.window= window
window.console= global.console
return import("../index.js");
}