( tag: string, attrs?: Attrs | null, ...children: Child[] )
| 21 | * Create an SVG element with attributes and children. |
| 22 | */ |
| 23 | export function svgEl( |
| 24 | tag: string, |
| 25 | attrs?: Attrs | null, |
| 26 | ...children: Child[] |
| 27 | ): SVGElement { |
| 28 | const el = document.createElementNS('http://www.w3.org/2000/svg', tag); |
| 29 | applyAttrs(el, attrs); |
| 30 | appendChildren(el, children); |
| 31 | return el; |
| 32 | } |
| 33 | |
| 34 | function applyAttrs(el: Element, attrs?: Attrs | null) { |
| 35 | if (!attrs) return; |
no test coverage detected