MCPcopy Create free account
hub / github.com/andreadev-it/stacking-contexts-inspector / getSVGHTML

Function getSVGHTML

src/scripts/components/SVG.js:12–17  ·  view source on GitHub ↗

Get the svg element as a string from a file source

(src)

Source from the content-addressed store, hash-verified

10
11/** Get the svg element as a string from a file source */
12async function getSVGHTML(src) {
13 let file = await fetch(src);
14 let content = await file.text();
15 let SVGElement = svgFromString(content);
16 return SVGElement.outerHTML;
17}
18
19/** Creates an inline SVG from a source */
20const SVG = ({src, ...props}) => {

Callers 1

SVGFunction · 0.85

Calls 1

svgFromStringFunction · 0.85

Tested by

no test coverage detected