From 765a9686d82b3a085afc5b8db16b3698131cbb4a Mon Sep 17 00:00:00 2001 From: Dolan Date: Mon, 12 Nov 2018 13:17:53 +0000 Subject: [PATCH] Remove async await for Compiler.compile --- src/export/packer/next-compiler.spec.ts | 4 ++-- src/export/packer/next-compiler.ts | 2 +- src/export/packer/packer.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/export/packer/next-compiler.spec.ts b/src/export/packer/next-compiler.spec.ts index 2ac32dda33..dec853ba68 100644 --- a/src/export/packer/next-compiler.spec.ts +++ b/src/export/packer/next-compiler.spec.ts @@ -17,7 +17,7 @@ describe("Compiler", () => { describe("#compile()", () => { it("should pack all the content", async function() { this.timeout(99999999); - const zipFile = await compiler.compile(file); + const zipFile = compiler.compile(file); const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name); expect(fileNames).is.an.instanceof(Array); @@ -46,7 +46,7 @@ describe("Compiler", () => { this.timeout(99999999); - const zipFile = await compiler.compile(file); + const zipFile = compiler.compile(file); const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name); expect(fileNames).is.an.instanceof(Array); diff --git a/src/export/packer/next-compiler.ts b/src/export/packer/next-compiler.ts index d311cf310c..0485ca684f 100644 --- a/src/export/packer/next-compiler.ts +++ b/src/export/packer/next-compiler.ts @@ -33,7 +33,7 @@ export class Compiler { this.formatter = new Formatter(); } - public async compile(file: File): Promise { + public compile(file: File): JSZip { const zip = new JSZip(); const xmlifiedFileMapping = this.xmlifyFile(file); diff --git a/src/export/packer/packer.ts b/src/export/packer/packer.ts index 856f74b59e..5f4c12c66f 100644 --- a/src/export/packer/packer.ts +++ b/src/export/packer/packer.ts @@ -9,7 +9,7 @@ export class Packer { } public async toBuffer(file: File): Promise { - const zip = await this.compiler.compile(file); + const zip = this.compiler.compile(file); const zipData = (await zip.generateAsync({ type: "nodebuffer", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", @@ -19,7 +19,7 @@ export class Packer { } public async toBase64String(file: File): Promise { - const zip = await this.compiler.compile(file); + const zip = this.compiler.compile(file); const zipData = (await zip.generateAsync({ type: "base64", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", @@ -29,7 +29,7 @@ export class Packer { } public async toBlob(file: File): Promise { - const zip = await this.compiler.compile(file); + const zip = this.compiler.compile(file); const zipData = (await zip.generateAsync({ type: "blob", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",