UNPKG

@ungap/insert-after

Version:

A Node.prototype.insertAfter polyfill

6 lines (5 loc) 222 B
/*! (c) Andrea Giammarchi - ISC */ if (!('insertAfter' in Node.prototype)) Node.prototype.insertAfter = function insertAfter(node, ref) { return this.insertBefore(node, ref ? ref.nextSibling : this.firstChild); };