@gechiui/dom
Version:
DOM utilities module for GeChiUI.
26 lines (22 loc) • 717 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = insertAfter;
var _assertIsDefined = require("../utils/assert-is-defined");
/**
* Internal dependencies
*/
/**
* Given two DOM nodes, inserts the former in the DOM as the next sibling of
* the latter.
*
* @param {Node} newNode Node to be inserted.
* @param {Node} referenceNode Node after which to perform the insertion.
* @return {void}
*/
function insertAfter(newNode, referenceNode) {
(0, _assertIsDefined.assertIsDefined)(referenceNode.parentNode, 'referenceNode.parentNode');
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
//# sourceMappingURL=insert-after.js.map