function append(elem, next) {
    removeElement(next);
    const { parent } = elem;
    const currNext = elem.next;
    next.next = currNext;
    next.prev = elem;
    elem.next = next;
    next.parent = parent;
    if (currNext) {
        currNext.prev = next;
        if (parent) {
            const childs = parent.children;
            childs.splice(childs.lastIndexOf(currNext), 0, next);
        }
    }
    else if (parent) {
        parent.children.push(next);
    }
}
/**
 * Append an element after another.
 *
 * @category Manipulation
 * @param elem The element to append after.
 * @param next The element be added.
 */
Append an element after another.
@category Manipulation
@param elem The element to append after.
@param next The element be added.
Append an element after another . @category Manipulation @param elem The element to append after . @param next The element be added .
function append(elem, next) {
    removeElement(next);
    const { parent } = elem;
    const currNext = elem.next;
    next.next = currNext;
    next.prev = elem;
    elem.next = next;
    next.parent = parent;
    if (currNext) {
        currNext.prev = next;
        if (parent) {
            const childs = parent.children;
            childs.splice(childs.lastIndexOf(currNext), 0, next);
        }
    }
    else if (parent) {
        parent.children.push(next);
    }
}
function append ( elem , next ) { removeElement ( next ) ; const { parent } = elem ; const currNext = elem . next ; next . next = currNext ; next . prev = elem ; elem . next = next ; next . parent = parent ; if ( currNext ) { currNext . prev = next ; if ( parent ) { const childs = parent . children ; childs . splice ( childs . lastIndexOf ( currNext ) , 0 , next ) ; } } else if ( parent ) { parent . children . push ( next ) ; } }
Append an element after another.
Append an element after another .