/**
 * insertAfter.js
 *
 * @Author: apple
 * @Date: 2018/1/3 19:45
 */

var insertAfter = function insertAfter(newEl, targetEl) {
    var parentEl = targetEl.parentNode;

    if (parentEl.lastChild == targetEl) {
        parentEl.appendChild(newEl);
    } else {
        parentEl.insertBefore(newEl, targetEl.nextSibling);
    }
};

export default insertAfter;