"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = require("./base");
exports.BaseXmlComponent = base_1.BaseXmlComponent;
class XmlComponent extends base_1.BaseXmlComponent {
    constructor(rootKey) {
        super(rootKey);
        this.root = new Array();
    }
    prepForXml() {
        const children = this.root.map((comp) => {
            if (comp instanceof base_1.BaseXmlComponent) {
                return comp.prepForXml();
            }
            return comp;
        }).filter((comp) => comp);
        return {
            [this.rootKey]: children,
        };
    }
}
exports.XmlComponent = XmlComponent;
//# sourceMappingURL=xml-component.js.map