import * as fs from "fs";
import { Document } from "../../docx/document";
import { Numbering } from "../../numbering";
import { Properties } from "../../properties";
import { Styles } from "../../styles";
import { Packer } from "./packer";

export class LocalPacker extends Packer {
    private stream: fs.WriteStream;

    constructor(document: Document, styles?: Styles, properties?: Properties, numbering?: Numbering) {
        super(document, styles, properties, numbering);
    }

    public pack(path: string): void {
        path = path.replace(/.docx$/, "");
        this.stream = fs.createWriteStream(`${path}.docx`);
        super.pack(this.stream);
    }
}

import * as fs from "fs";
import { Document } from "../../docx/document";
import { Numbering } from "../../numbering";
import { Properties } from "../../properties";
import { Styles } from "../../styles";
import { Packer } from "./packer";

export class LocalPacker extends Packer {
    private stream: fs.WriteStream;

    constructor(document: Document, styles?: Styles, properties?: Properties, numbering?: Numbering) {
        super(document, styles, properties, numbering);
    }

    public pack(path: string): void {
        this.stream = fs.createWriteStream(`${path}.docx`);
        super.pack(this.stream);
    }
}

Revert "fixed the build :P removed .docx extension if one is already present"
Revert "fixed the build :P removed .docx extension if one is already present"

This reverts commit 9f61ca7abeefa05e91c9ca30a6b3998fb65c1704.
