⌈⌋ ⎇ branch:  Bitrhythm


Artifact Content

Artifact 325f630962dda2ed70aeea9e823aad11bffc8209fa2a749e324d2d64b9b82d71:


/**
 * Insert safely a tag to fix #1962 #1649
 * @param   { HTMLElement } root - children container
 * @param   { HTMLElement } curr - node to insert
 * @param   { HTMLElement } next - node that should preceed the current node inserted
 */
export default function safeInsert(root, curr, next) {
  root.insertBefore(curr, next.parentNode && next)
}