Trying to upgrade docx to use Vite

This commit is contained in:
Dolan Miu
2023-05-01 20:37:39 +01:00
parent 18b2e91da2
commit a26292a0fd
20 changed files with 1178 additions and 312 deletions

View File

@ -1,5 +1,5 @@
import * as JSZip from "jszip";
import * as xml from "xml";
import JSZip from "jszip";
import xml from "xml";
import { File } from "@file/file";
@ -44,7 +44,7 @@ export class Compiler {
this.numberingReplacer = new NumberingReplacer();
}
public compile(file: File, prettifyXml?: boolean | PrettifyType): JSZip {
public compile(file: File, prettifyXml?: PrettifyType): JSZip {
const zip = new JSZip();
const xmlifiedFileMapping = this.xmlifyFile(file, prettifyXml);
const map = new Map<string, IXmlifyedFile | readonly IXmlifyedFile[]>(Object.entries(xmlifiedFileMapping));
@ -66,7 +66,7 @@ export class Compiler {
return zip;
}
private xmlifyFile(file: File, prettify?: boolean | PrettifyType): IXmlifyedFileMapping {
private xmlifyFile(file: File, prettify?: PrettifyType): IXmlifyedFileMapping {
const documentRelationshipCount = file.Document.Relationships.RelationshipCount + 1;
const documentXmlData = xml(