Made project Prettier compliant

This commit is contained in:
Dolan
2018-01-23 01:33:12 +00:00
parent f2027230a0
commit e93d6799fd
101 changed files with 1198 additions and 1207 deletions

View File

@ -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",

View File

@ -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 };
}
}

View File

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

View File

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

View File

@ -1,3 +1,3 @@
export interface IXmlableObject extends Object {
_attr?: { [key: string]: (string | number | boolean) };
_attr?: { [key: string]: string | number | boolean };
}