polyfill-service
Version:
A polyfill combinator
1 lines • 1.23 kB
JSON
{"browsers":{"android":"*","bb":"*","chrome":"*","firefox":"*","ios_chr":"*","ios_saf":"*","ie":"*","ie_mob":"10 - *","opera":"*","op_mini":"*","safari":"*","firefox_mob":"*"},"dependencies":["Document","Element","Text"],"baseDir":"_mutation","hasTests":false,"rawSource":"\n// _mutation\n// http://dom.spec.whatwg.org/#mutation-method-macro\nfunction _mutation(nodes) {\n\tif (!nodes.length) {\n\t\tthrow new Error('DOM Exception 8');\n\t} else if (nodes.length === 1) {\n\t\treturn typeof nodes[0] === 'string' ? document.createTextNode(nodes[0]) : nodes[0];\n\t} else {\n\t\tvar\n\t\tfragment = document.createDocumentFragment(),\n\t\tlength = nodes.length,\n\t\tindex = -1,\n\t\tnode;\n\n\t\twhile (++index < length) {\n\t\t\tnode = nodes[index];\n\n\t\t\tfragment.appendChild(typeof node === 'string' ? document.createTextNode(node) : node);\n\t\t}\n\n\t\treturn fragment;\n\t}\n}\n","minSource":"function _mutation(e){if(e.length){if(1===e.length)return\"string\"==typeof e[0]?document.createTextNode(e[0]):e[0];for(var t,n=document.createDocumentFragment(),r=e.length,o=-1;++o<r;)t=e[o],n.appendChild(\"string\"==typeof t?document.createTextNode(t):t);return n}throw new Error(\"DOM Exception 8\")}","detectSource":""}