PromucFlow_constructor/app/client/src/workers/Evaluation/SetupDOM.ts
Satish Gandham 83538ad74d
feat: Bundle optimization and first load improvements (#21667)
Co-authored-by: Ivan Akulov <mail@iamakulov.com>
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Ivan Akulov <iamakulov@outlook.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: somangshu <somangshu.goswami1508@gmail.com>
2023-05-11 10:56:03 +05:30

14 lines
389 B
TypeScript

//@ts-expect-error no types.
import * as documentMock from "linkedom/worker";
export default function () {
for (const [key, value] of Object.entries(documentMock)) {
//@ts-expect-error no types
self[key] = value;
}
const dom = documentMock.parseHTML(`<!DOCTYPE html><body></body>`);
self.window = dom.window;
self.document = dom.window.document;
self.window = self;
}