Archived
1
0

Bit of cleanup, some test fixes, moving some funcs

This commit is contained in:
Asher
2019-02-06 16:45:11 -06:00
parent dc1a16ee0b
commit 5ea1d8b2aa
6 changed files with 180 additions and 162 deletions

View File

@ -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);
}

View File

@ -13,7 +13,6 @@ class Net implements NodeNet {
) {}
public get Socket(): typeof net.Socket {
// @ts-ignore
return this.client.Socket;
}

View File

@ -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();
});