MCPcopy Create free account
hub / github.com/Web3Auth/Auth / htmlToElement

Function htmlToElement

src/utils/utils.ts:12–17  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

10}
11
12export const htmlToElement = <T extends Element>(html: string): T => {
13 const template = window.document.createElement("template");
14 const trimmedHtml = html.trim(); // Never return a text node of whitespace as the result
15 template.innerHTML = trimmedHtml;
16 return template.content.firstChild as T;
17};
18
19export function cloneDeep<T>(object: T): T {
20 try {

Callers 1

initMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected