diff --git a/src/export/packer/packer.spec.ts b/src/export/packer/packer.spec.ts index b7eed87187..a0e9f10326 100644 --- a/src/export/packer/packer.spec.ts +++ b/src/export/packer/packer.spec.ts @@ -12,7 +12,7 @@ describe("Packer", () => { beforeEach(() => { file = new File({ creator: "Dolan Miu", - revision: "1", + revision: 1, lastModifiedBy: "Dolan Miu", sections: [ { diff --git a/src/file/core-properties/properties.spec.ts b/src/file/core-properties/properties.spec.ts index 4d0b57f0f4..7947d98e92 100644 --- a/src/file/core-properties/properties.spec.ts +++ b/src/file/core-properties/properties.spec.ts @@ -38,7 +38,7 @@ describe("Properties", () => { keywords: "test docx", description: "testing document", lastModifiedBy: "the author", - revision: "123", + revision: 123, }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["cp:coreProperties"]); diff --git a/src/file/core-properties/properties.ts b/src/file/core-properties/properties.ts index 57a869a167..f323c94981 100644 --- a/src/file/core-properties/properties.ts +++ b/src/file/core-properties/properties.ts @@ -17,7 +17,7 @@ export interface IPropertiesOptions { readonly keywords?: string; readonly description?: string; readonly lastModifiedBy?: string; - readonly revision?: string; + readonly revision?: number; readonly externalStyles?: string; readonly styles?: IStylesOptions; readonly numbering?: INumberingOptions; @@ -89,7 +89,7 @@ export class CoreProperties extends XmlComponent { this.root.push(new StringContainer("cp:lastModifiedBy", options.lastModifiedBy)); } if (options.revision) { - this.root.push(new StringContainer("cp:revision", options.revision)); + this.root.push(new StringContainer("cp:revision", String(options.revision))); } this.root.push(new TimestampElement("dcterms:created")); this.root.push(new TimestampElement("dcterms:modified")); diff --git a/src/file/file.ts b/src/file/file.ts index 0e6c9fc352..00e91efdd5 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -57,7 +57,7 @@ export class File { this.coreProperties = new CoreProperties({ ...options, creator: options.creator ?? "Un-named", - revision: options.revision ?? "1", + revision: options.revision ?? 1, lastModifiedBy: options.lastModifiedBy ?? "Un-named", });