Made project Prettier compliant
This commit is contained in:
@ -4,7 +4,6 @@ import { Attributes } from "./";
|
||||
|
||||
describe("Attribute", () => {
|
||||
describe("#constructor()", () => {
|
||||
|
||||
it("should have val as defined with populated constructor", () => {
|
||||
const newAttrs = new Attributes({
|
||||
val: "test",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BaseXmlComponent } from "./base";
|
||||
import { IXmlableObject } from "./xmlable-object";
|
||||
|
||||
export type AttributeMap<T> = {[P in keyof T]: string};
|
||||
export type AttributeMap<T> = { [P in keyof T]: string };
|
||||
|
||||
export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
|
||||
protected root: T;
|
||||
@ -21,6 +21,6 @@ export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
|
||||
attrs[newKey] = value;
|
||||
}
|
||||
});
|
||||
return {_attr: attrs};
|
||||
return { _attr: attrs };
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,7 @@ import { assert } from "chai";
|
||||
import { Utility } from "../../tests/utility";
|
||||
import { XmlComponent } from "./";
|
||||
|
||||
class TestComponent extends XmlComponent {
|
||||
|
||||
}
|
||||
class TestComponent extends XmlComponent {}
|
||||
|
||||
describe("XmlComponent", () => {
|
||||
let xmlComponent: TestComponent;
|
||||
@ -15,7 +13,6 @@ describe("XmlComponent", () => {
|
||||
});
|
||||
|
||||
describe("#constructor()", () => {
|
||||
|
||||
it("should create an Xml Component which has the correct rootKey", () => {
|
||||
const newJson = Utility.jsonify(xmlComponent);
|
||||
assert.equal(newJson.rootKey, "w:test");
|
||||
|
@ -11,12 +11,14 @@ export abstract class XmlComponent extends BaseXmlComponent {
|
||||
}
|
||||
|
||||
public prepForXml(): IXmlableObject {
|
||||
const children = this.root.map((comp) => {
|
||||
if (comp instanceof BaseXmlComponent) {
|
||||
return comp.prepForXml();
|
||||
}
|
||||
return comp;
|
||||
}).filter((comp) => comp); // Exclude null, undefined, and empty strings
|
||||
const children = this.root
|
||||
.map((comp) => {
|
||||
if (comp instanceof BaseXmlComponent) {
|
||||
return comp.prepForXml();
|
||||
}
|
||||
return comp;
|
||||
})
|
||||
.filter((comp) => comp); // Exclude null, undefined, and empty strings
|
||||
return {
|
||||
[this.rootKey]: children,
|
||||
};
|
||||
|
@ -1,3 +1,3 @@
|
||||
export interface IXmlableObject extends Object {
|
||||
_attr?: { [key: string]: (string | number | boolean) };
|
||||
_attr?: { [key: string]: string | number | boolean };
|
||||
}
|
||||
|
Reference in New Issue
Block a user