diff --git a/package.json b/package.json index d498574ebd..3630b57b88 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "clippy" ], "dependencies": { - "@types/archiver": "^0.15.37", + "@types/archiver": "^1.3.2", "@types/express": "^4.0.35", "archiver": "^1.3.0", "xml": "^1.0.1" diff --git a/ts/export/packer/express.ts b/ts/export/packer/express.ts index 16722ff484..7277051c72 100644 --- a/ts/export/packer/express.ts +++ b/ts/export/packer/express.ts @@ -20,6 +20,6 @@ export class ExpressPacker extends Packer { public pack(name: string): void { this.res.attachment(`${name}.docx`); - super.pack(this.res); + super.compile(this.res); } } diff --git a/ts/export/packer/local.ts b/ts/export/packer/local.ts index bbb10e2a5a..d255147b16 100644 --- a/ts/export/packer/local.ts +++ b/ts/export/packer/local.ts @@ -16,6 +16,6 @@ export class LocalPacker extends Packer { public pack(path: string): void { path = path.replace(/.docx$/, ""); this.stream = fs.createWriteStream(`${path}.docx`); - super.pack(this.stream); + super.compile(this.stream); } } diff --git a/ts/export/packer/packer.ts b/ts/export/packer/packer.ts index 7ca1fcc847..6a162bca65 100644 --- a/ts/export/packer/packer.ts +++ b/ts/export/packer/packer.ts @@ -1,4 +1,5 @@ import * as archiver from "archiver"; +import * as express from "express"; import * as fs from "fs"; import * as path from "path"; import * as xml from "xml"; @@ -13,7 +14,7 @@ import { Formatter } from "../formatter"; const TEMPLATE_PATH = path.resolve(__dirname, "../../../template"); export abstract class Packer { - protected archive: any; + protected archive: archiver.Archiver; private formatter: Formatter; private style: Styles; @@ -43,15 +44,13 @@ export abstract class Packer { }); } - public pack(output: Express.Response | fs.WriteStream): void { + protected compile(output: fs.WriteStream | express.Response): void { this.archive.pipe(output); this.archive.glob("**", { - expand: true, cwd: TEMPLATE_PATH, }); this.archive.glob("**/.rels", { - expand: true, cwd: TEMPLATE_PATH, });