Change type of revision to a number

This commit is contained in:
Rowan Cockett
2021-10-08 15:52:12 -06:00
parent abbd620220
commit 47099d0468
4 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ describe("Packer", () => {
beforeEach(() => {
file = new File({
creator: "Dolan Miu",
revision: "1",
revision: 1,
lastModifiedBy: "Dolan Miu",
sections: [
{

View File

@ -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"]);

View File

@ -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"));

View File

@ -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",
});