"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceChild = replaceChild;
const getChildIndex_1 = require("./getChildIndex");
function replaceChild($element, $nextElement) {
    const parent = $element.parentElement;
    if (parent) {
        const index = (0, getChildIndex_1.getChildIndex)($element);
        parent.insertBefore($nextElement, parent.children[index]);
        parent.removeChild($element);
    }
}
//# sourceMappingURL=replaceChild.js.map