diff --git a/ts/docx/xml-components/index.ts b/ts/docx/xml-components/index.ts index 93756514be..9be5c0d219 100644 --- a/ts/docx/xml-components/index.ts +++ b/ts/docx/xml-components/index.ts @@ -1,27 +1,3 @@ -import { BaseXmlComponent } from "./base"; -import { IXmlableObject } from "./xmlable-object"; -export { BaseXmlComponent }; - -export abstract class XmlComponent extends BaseXmlComponent { - protected root: Array; - - constructor(rootKey: string) { - super(rootKey); - this.root = new Array(); - } - - 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 - return { - [this.rootKey]: children, - }; - } -} - +export * from "./xml-component"; export * from "./attributes"; export * from "./default-attributes"; diff --git a/ts/docx/xml-components/xml-component.ts b/ts/docx/xml-components/xml-component.ts new file mode 100644 index 0000000000..ebfbbbc485 --- /dev/null +++ b/ts/docx/xml-components/xml-component.ts @@ -0,0 +1,24 @@ +import { BaseXmlComponent } from "./base"; +import { IXmlableObject } from "./xmlable-object"; +export { BaseXmlComponent }; + +export abstract class XmlComponent extends BaseXmlComponent { + protected root: Array; + + constructor(rootKey: string) { + super(rootKey); + this.root = new Array(); + } + + 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 + return { + [this.rootKey]: children, + }; + } +}