MCPcopy
hub / github.com/shipshapecode/shepherd / svgEl

Function svgEl

shepherd.js/src/utils/dom.ts:23–32  ·  view source on GitHub ↗
(
  tag: string,
  attrs?: Attrs | null,
  ...children: Child[]
)

Source from the content-addressed store, hash-verified

21 * Create an SVG element with attributes and children.
22 */
23export 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
34function applyAttrs(el: Element, attrs?: Attrs | null) {
35 if (!attrs) return;

Callers 1

createShepherdModalFunction · 0.90

Calls 2

applyAttrsFunction · 0.85
appendChildrenFunction · 0.85

Tested by

no test coverage detected