UNPKG

@osaedasia/oresume

Version:

A user-friendly library for generating complete Single Page Applications (SPAs)

2 lines (1 loc) 565 B
class e{static createAttributeValuePattern(e){return new RegExp(`([a-zA-Z0-9-]+) *= *["'\`] *${e.source} *["'\`]`,"g")}static wrapHtmlInSingleDiv(e){const t=document.createElement("template");let n;t.innerHTML=e;const c=t.content.children.length;if(c>1){const e=document.createElement("div");for(;t.content.firstChild;)e.appendChild(t.content.firstChild);n=document.createDocumentFragment(),n.appendChild(e)}else if(0===c){const e=document.createElement("div");n=document.createDocumentFragment(),n.appendChild(e)}else n=t.content;return n}}export{e as DomHelper};