Bit of cleanup, some test fixes, moving some funcs
This commit is contained in:
@ -13,8 +13,10 @@ import { clipboard } from "./clipboard";
|
||||
return [];
|
||||
};
|
||||
|
||||
// This is required to make the fill load in Node without erroring.
|
||||
if (typeof document === "undefined") {
|
||||
(<any>global).document = {} as any;
|
||||
// tslint:disable-next-line no-any
|
||||
(global as any).document = {} as any;
|
||||
}
|
||||
|
||||
const oldCreateElement: <K extends keyof HTMLElementTagNameMap>(
|
||||
@ -52,7 +54,7 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
|
||||
if (view.contentDocument) {
|
||||
view.contentDocument.body.id = frameID;
|
||||
view.contentDocument.body.parentElement!.style.overflow = "hidden";
|
||||
const script = document.createElement("script");
|
||||
const script = createElement("script");
|
||||
script.src = url;
|
||||
view.contentDocument.head.appendChild(script);
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ class Net implements NodeNet {
|
||||
) {}
|
||||
|
||||
public get Socket(): typeof net.Socket {
|
||||
// @ts-ignore
|
||||
return this.client.Socket;
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ export class Upload {
|
||||
|
||||
await rm();
|
||||
|
||||
reader.addEventListener("load", async () => {
|
||||
const load = async (): Promise<void> => {
|
||||
const buffer = new Uint8Array(reader.result as ArrayBuffer);
|
||||
let bufferOffset = 0;
|
||||
|
||||
@ -259,7 +259,9 @@ export class Upload {
|
||||
}
|
||||
|
||||
seek();
|
||||
});
|
||||
};
|
||||
|
||||
reader.addEventListener("load", load);
|
||||
|
||||
seek();
|
||||
});
|
||||
|
Reference in New Issue
Block a user