Run updated prettier

This commit is contained in:
Max Lay
2020-08-04 08:50:56 +12:00
parent 870c222dd5
commit ec4c4fb5c4
2 changed files with 15 additions and 14 deletions

View File

@ -10,7 +10,7 @@ describe("CustomProperties", () => {
expect(tree).to.deep.equal({
Properties: {
_attr: {
"xmlns": "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
"xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",
},
},
@ -18,13 +18,16 @@ describe("CustomProperties", () => {
});
it("should create custom properties with all the attributes given", () => {
const properties = new CustomProperties([{ name: "Address", value: "123" }, { name: "Author", value: "456" }]);
const properties = new CustomProperties([
{ name: "Address", value: "123" },
{ name: "Author", value: "456" },
]);
const tree = new Formatter().format(properties);
expect(tree).to.deep.equal({
Properties: [
{
_attr: {
"xmlns": "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
"xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",
},
},
@ -38,9 +41,7 @@ describe("CustomProperties", () => {
},
},
{
"vt:lpwstr": [
"123",
],
"vt:lpwstr": ["123"],
},
],
},
@ -54,9 +55,7 @@ describe("CustomProperties", () => {
},
},
{
"vt:lpwstr": [
"456",
],
"vt:lpwstr": ["456"],
},
],
},

View File

@ -9,11 +9,13 @@ export interface ICustomPropertyOptions {
export class CustomProperty extends XmlComponent {
constructor(id: number, properties: ICustomPropertyOptions) {
super("property");
this.root.push(new CustomPropertyAttributes({
fmtid: "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
pid: id.toString(),
name: properties.name,
}));
this.root.push(
new CustomPropertyAttributes({
fmtid: "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
pid: id.toString(),
name: properties.name,
}),
);
this.root.push(new CustomPropertyValue(properties.value));
}
}