Merge pull request #1217 from curvenote/feat/revision
Change type of revision to a number
This commit is contained in:
@ -12,7 +12,7 @@ describe("Packer", () => {
|
||||
beforeEach(() => {
|
||||
file = new File({
|
||||
creator: "Dolan Miu",
|
||||
revision: "1",
|
||||
revision: 1,
|
||||
lastModifiedBy: "Dolan Miu",
|
||||
sections: [
|
||||
{
|
||||
|
@ -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"]);
|
||||
|
@ -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"));
|
||||
|
@ -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",
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user