Simplify tests and made compile async

This commit is contained in:
Dolan
2017-12-06 01:32:57 +00:00
parent ebec10e312
commit 5889f20f1e
3 changed files with 7 additions and 25 deletions

View File

@ -21,11 +21,11 @@ export class LocalPacker implements IPacker {
this.packer = new Compiler(document, styles, properties, numbering, media);
}
public pack(filePath: string): void {
public async pack(filePath: string): Promise<void> {
filePath = filePath.replace(/.docx$/, "");
this.stream = fs.createWriteStream(`${filePath}.docx`);
this.packer.compile(this.stream);
await this.packer.compile(this.stream);
}
public async packPdf(filePath: string): Promise<void> {