(type, attrs)
| 67 | }) |
| 68 | |
| 69 | function elt(type, attrs) { |
| 70 | let firstChild = 1 |
| 71 | let node = document.createElement(type) |
| 72 | if (attrs && typeof attrs == "object" && attrs.nodeType == null) { |
| 73 | for (let attr in attrs) if (attrs.hasOwnProperty(attr)) { |
| 74 | let value = attrs[attr] |
| 75 | if (attr == "css") node.style.cssText = value |
| 76 | else if (typeof value !== "string") node[attr] = value |
| 77 | else node.setAttribute(attr, value) |
| 78 | } |
| 79 | firstChild = 2 |
| 80 | } |
| 81 | for (let i = firstChild; i < arguments.length; ++i) { |
| 82 | let child = arguments[i] |
| 83 | if (typeof child == "string") child = document.createTextNode(child) |
| 84 | node.appendChild(child) |
| 85 | } |
| 86 | return node |
| 87 | } |
| 88 | |
| 89 | const contextFacet = Facet.define({ |
| 90 | combine(vs) { return vs[0] } |
no outgoing calls
no test coverage detected