"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var applyLayout_1 = require("./applyLayout");
var createTagNode_1 = require("./createTagNode");
var createTextNode_1 = require("./createTextNode");
var isTextNode_1 = require("./isTextNode");
function appendChild(alreadyChildElement, virtualElement, parentDomElement, parentVirtualElement, component) {
    var domElementToInsert = isTextNode_1.default(virtualElement)
        ? createTextNode_1.default(parentDomElement, virtualElement)
        : createTagNode_1.default(parentDomElement, virtualElement, parentVirtualElement, component);
    applyLayout_1.default(domElementToInsert, virtualElement, parentDomElement, parentVirtualElement, component, null);
    parentDomElement.appendChild(domElementToInsert);
    return domElementToInsert;
}
exports.default = appendChild;
//# sourceMappingURL=appendChild.js.map