Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
: (`${value}`).split(' ');
el.classList.add(...value.filter(Boolean));
} else if (attr in el || attr === 'data' || attr.startsWith('_')) {
(el as any)[attr.replace(/^_/, '')] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr] as string);
}
}
const childrenCt = el.tagName === 'TEMPLATE' ? (el as HTMLTemplateElement).content : el;
for (const child of children) {
if (child === null || child === undefined) {
continue;
}
childrenCt.appendChild(isNodeOrTextOrComment(child)
? child
: DOM.createTextNode(`${child}`)
);
}
return el as any;
}
}
else if (attr in el || attr === 'data' || attr.startsWith('_')) {
el[attr.replace(/^_/, '')] = attrs[attr];
}
else {
el.setAttribute(attr, attrs[attr]);
}
}
const childrenCt = el.tagName === 'TEMPLATE' ? el.content : el;
for (const child of children) {
if (child === null || child === undefined) {
continue;
}
childrenCt.appendChild(isNodeOrTextOrComment(child)
? child
: DOM.createTextNode(`${child}`));
}
return el;
}
function isNodeOrTextOrComment(obj) {